-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathonem2m.m.keypad.json
More file actions
51 lines (51 loc) · 2.46 KB
/
onem2m.m.keypad.json
File metadata and controls
51 lines (51 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"id": "http://openinterconnect.org/onem2mmapping/schemas/onem2m.m.keypad.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description" : "Copyright (c) 2018 Open Connectivity Foundation, Inc. All rights reserved.",
"title": "Keypad",
"definitions": {
"onem2m.m.keypad": {
"type": "object",
"properties": {
"keyNumber": {
"type": "integer",
"description": "The number of key.",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.keypadchar",
"x-to-ocf": [
"Need to translate between the oneM2M integer value and the OCF enumerated string",
"if ( keyNumber == 0 ) { oic.r.keypadchar.keyvalue == \"0\"; }",
"if ( keyNumber == 1 ) { oic.r.keypadchar.keyvalue == \"1\"; }",
"if ( keyNumber == 2 ) { oic.r.keypadchar.keyvalue == \"2\"; }",
"if ( keyNumber == 3 ) { oic.r.keypadchar.keyvalue == \"3\"; }",
"if ( keyNumber == 4 ) { oic.r.keypadchar.keyvalue == \"4\"; }",
"if ( keyNumber == 5 ) { oic.r.keypadchar.keyvalue == \"5\"; }",
"if ( keyNumber == 6 ) { oic.r.keypadchar.keyvalue == \"6\"; }",
"if ( keyNumber == 7 ) { oic.r.keypadchar.keyvalue == \"7\"; }",
"if ( keyNumber == 8 ) { oic.r.keypadchar.keyvalue == \"8\"; }",
"if ( keyNumber == 9 ) { oic.r.keypadchar.keyvalue == \"9\"; }"
],
"x-from-ocf": [
"Need to translate between the OCF enumerated string and the oneM2M integer value",
"if (oic.r.keypadchar.keyvalue == \"0\" ) { keyNumber = 0; }",
"if (oic.r.keypadchar.keyvalue == \"1\" ) { keyNumber = 1; }",
"if (oic.r.keypadchar.keyvalue == \"2\" ) { keyNumber = 2; }",
"if (oic.r.keypadchar.keyvalue == \"3\" ) { keyNumber = 3; }",
"if (oic.r.keypadchar.keyvalue == \"4\" ) { keyNumber = 4; }",
"if (oic.r.keypadchar.keyvalue == \"5\" ) { keyNumber = 5; }",
"if (oic.r.keypadchar.keyvalue == \"6\" ) { keyNumber = 6; }",
"if (oic.r.keypadchar.keyvalue == \"7\" ) { keyNumber = 7; }",
"if (oic.r.keypadchar.keyvalue == \"8\" ) { keyNumber = 8; }",
"if (oic.r.keypadchar.keyvalue == \"9\" ) { keyNumber = 9; }"
]
}
}
}
}
},
"type": "object",
"allOf": [
{"$ref": "#/definitions/onem2m.m.keypad"}
],
"required": [ "keyNumber" ]
}