mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-10-30 01:32:26 +00:00
renderer: fix passpoint support
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -11,4 +11,4 @@ mkdir -p docs
|
|||||||
generate-schema-doc --config expand_buttons=true ucentral.schema.pretty.json docs/ucentral-schema.html
|
generate-schema-doc --config expand_buttons=true ucentral.schema.pretty.json docs/ucentral-schema.html
|
||||||
generate-schema-doc --config expand_buttons=true ucentral.state.pretty.json docs/ucentral-state.html
|
generate-schema-doc --config expand_buttons=true ucentral.state.pretty.json docs/ucentral-state.html
|
||||||
./generate-reader.uc > schemareader.uc
|
./generate-reader.uc > schemareader.uc
|
||||||
./generate-example.uc > input.json
|
#./generate-example.uc > input.json
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ set wireless.{{ section }}.rssi_ignore_probe_request={{ ssid.quality_thresholds.
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if (ssid.pass_point): %}
|
{% if (ssid.pass_point): %}
|
||||||
set wireless.{{ section }}.iw_enable=1
|
set wireless.{{ section }}.iw_enabled=1
|
||||||
set wireless.{{ section }}.hs20=1
|
set wireless.{{ section }}.hs20=1
|
||||||
{% for (let name in ssid.pass_point.venue_name): %}
|
{% for (let name in ssid.pass_point.venue_name): %}
|
||||||
add_list wireless.{{ section }}.iw_venue_name={{ s(name) }}
|
add_list wireless.{{ section }}.iw_venue_name={{ s(name) }}
|
||||||
@@ -294,12 +294,22 @@ set wireless.{{ section }}.iw_nai_realm='{{ realm }}'
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
set wireless.{{ section }}.osen={{ b(ssid.pass_point.osen) }}
|
set wireless.{{ section }}.osen={{ b(ssid.pass_point.osen) }}
|
||||||
set wireless.{{ section }}.anqp_domain_id='{{ ssid.pass_point.anqp_domain }}'
|
set wireless.{{ section }}.anqp_domain_id='{{ ssid.pass_point.anqp_domain }}'
|
||||||
set wireless.{{ section }}.anqp_3gpp_cell_net='{{ ssid.anqp_3gpp_cell_net }}'
|
{% for (let cell_net in ssid.pass_point.anqp_3gpp_cell_net): %}
|
||||||
|
add_list wireless.{{ section }}.iw_anqp_3gpp_cell_net='{{ s(cell_net) }}'
|
||||||
|
{% endfor %}
|
||||||
{% for (let name in ssid.pass_point.friendly_name): %}
|
{% for (let name in ssid.pass_point.friendly_name): %}
|
||||||
add_list wireless.{{ section }}.hs20_oper_friendly_name={{ s(name) }}
|
add_list wireless.{{ section }}.hs20_oper_friendly_name={{ s(name) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for (let icon in ssid.pass_point.icon): %}
|
{% endif %}
|
||||||
add_list wireless.{{ section }}.operator_icon={{ s(icon.uri) }}
|
|
||||||
|
{% if (ssid.pass_point): %}
|
||||||
|
{% for (let id, icon in ssid.pass_point.icons): %}
|
||||||
|
add wireless hs20-icon
|
||||||
|
set wireless.@hs20-icon[-1].width={{ s(icon.width) }}
|
||||||
|
set wireless.@hs20-icon[-1].height={{ s(icon.height) }}
|
||||||
|
set wireless.@hs20-icon[-1].type={{ s(icon.type) }}
|
||||||
|
set wireless.@hs20-icon[-1].lang={{ s(icon.language) }}
|
||||||
|
set wireless.@hs20-icon[-1].path={{ s(files.add_anonymous(location, 'hs20_icon_' + id, b64dec(icon.icon))) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ properties:
|
|||||||
anqp-3gpp-cell-net:
|
anqp-3gpp-cell-net:
|
||||||
description:
|
description:
|
||||||
The ANQP 3GPP Cellular Network information.
|
The ANQP 3GPP Cellular Network information.
|
||||||
type: string
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
friendly-name:
|
friendly-name:
|
||||||
description:
|
description:
|
||||||
This parameter can be used to configure one or more Operator Friendly
|
This parameter can be used to configure one or more Operator Friendly
|
||||||
@@ -85,7 +87,7 @@ properties:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
icon:
|
icons:
|
||||||
description:
|
description:
|
||||||
The operator icons.
|
The operator icons.
|
||||||
type: array
|
type: array
|
||||||
@@ -107,12 +109,10 @@ properties:
|
|||||||
description: The mimetype of the operator icon
|
description: The mimetype of the operator icon
|
||||||
examples:
|
examples:
|
||||||
- image/png
|
- image/png
|
||||||
uri:
|
icon:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uc-base64
|
||||||
description: The URL the operator icon is available at
|
description: The base64 encoded image
|
||||||
examples:
|
|
||||||
- http://example.org/operator-64x64.png
|
|
||||||
language:
|
language:
|
||||||
type: string
|
type: string
|
||||||
description: ISO 639-2 language code of the icon
|
description: ISO 639-2 language code of the icon
|
||||||
@@ -126,15 +126,5 @@ properties:
|
|||||||
- width: 32
|
- width: 32
|
||||||
height: 32
|
height: 32
|
||||||
type: image/png
|
type: image/png
|
||||||
uri: http://example.org/operator-32x32.png
|
|
||||||
language: eng
|
|
||||||
- width: 64
|
|
||||||
height: 64
|
|
||||||
type: image/png
|
|
||||||
uri: http://example.org/operator-64x64.png
|
|
||||||
language: eng
|
|
||||||
- width: 16
|
|
||||||
height: 16
|
|
||||||
type: image/gif
|
|
||||||
uri: data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7
|
|
||||||
language: eng
|
language: eng
|
||||||
|
icon: R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7
|
||||||
|
|||||||
@@ -2676,8 +2676,19 @@ function instantiateInterfaceSsidPassPoint(location, value, errors) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseAnqp3gppCellNet(location, value, errors) {
|
function parseAnqp3gppCellNet(location, value, errors) {
|
||||||
if (type(value) != "string")
|
if (type(value) == "array") {
|
||||||
push(errors, [ location, "must be of type string" ]);
|
function parseItem(location, value, errors) {
|
||||||
|
if (type(value) != "string")
|
||||||
|
push(errors, [ location, "must be of type string" ]);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return map(value, (item, i) => parseItem(location + "/" + i, item, errors));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type(value) != "array")
|
||||||
|
push(errors, [ location, "must be of type array" ]);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -2708,7 +2719,7 @@ function instantiateInterfaceSsidPassPoint(location, value, errors) {
|
|||||||
obj.friendly_name = parseFriendlyName(location + "/friendly-name", value["friendly-name"], errors);
|
obj.friendly_name = parseFriendlyName(location + "/friendly-name", value["friendly-name"], errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseIcon(location, value, errors) {
|
function parseIcons(location, value, errors) {
|
||||||
if (type(value) == "array") {
|
if (type(value) == "array") {
|
||||||
function parseItem(location, value, errors) {
|
function parseItem(location, value, errors) {
|
||||||
if (type(value) == "object") {
|
if (type(value) == "object") {
|
||||||
@@ -2747,10 +2758,10 @@ function instantiateInterfaceSsidPassPoint(location, value, errors) {
|
|||||||
obj.type = parseType(location + "/type", value["type"], errors);
|
obj.type = parseType(location + "/type", value["type"], errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseUri(location, value, errors) {
|
function parseIcon(location, value, errors) {
|
||||||
if (type(value) == "string") {
|
if (type(value) == "string") {
|
||||||
if (!matchUri(value))
|
if (!matchUcBase64(value))
|
||||||
push(errors, [ location, "must be a valid URI" ]);
|
push(errors, [ location, "must be a valid base64 encoded data" ]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2760,8 +2771,8 @@ function instantiateInterfaceSsidPassPoint(location, value, errors) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists(value, "uri")) {
|
if (exists(value, "icon")) {
|
||||||
obj.uri = parseUri(location + "/uri", value["uri"], errors);
|
obj.icon = parseIcon(location + "/icon", value["icon"], errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseLanguage(location, value, errors) {
|
function parseLanguage(location, value, errors) {
|
||||||
@@ -2799,8 +2810,8 @@ function instantiateInterfaceSsidPassPoint(location, value, errors) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists(value, "icon")) {
|
if (exists(value, "icons")) {
|
||||||
obj.icon = parseIcon(location + "/icon", value["icon"], errors);
|
obj.icons = parseIcons(location + "/icons", value["icons"], errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
@@ -1027,7 +1027,10 @@
|
|||||||
"minimum": 0
|
"minimum": 0
|
||||||
},
|
},
|
||||||
"anqp-3gpp-cell-net": {
|
"anqp-3gpp-cell-net": {
|
||||||
"type": "string"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"friendly-name": {
|
"friendly-name": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -1035,7 +1038,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"icon": {
|
"icons": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -1058,12 +1061,9 @@
|
|||||||
"image/png"
|
"image/png"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"uri": {
|
"icon": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uri",
|
"format": "uc-base64"
|
||||||
"examples": [
|
|
||||||
"http://example.org/operator-64x64.png"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1081,22 +1081,8 @@
|
|||||||
"width": 32,
|
"width": 32,
|
||||||
"height": 32,
|
"height": 32,
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"uri": "http://example.org/operator-32x32.png",
|
"language": "eng",
|
||||||
"language": "eng"
|
"icon": "R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7"
|
||||||
},
|
|
||||||
{
|
|
||||||
"width": 64,
|
|
||||||
"height": 64,
|
|
||||||
"type": "image/png",
|
|
||||||
"uri": "http://example.org/operator-64x64.png",
|
|
||||||
"language": "eng"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"width": 16,
|
|
||||||
"height": 16,
|
|
||||||
"type": "image/gif",
|
|
||||||
"uri": "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7",
|
|
||||||
"language": "eng"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user