//header files define the enumeration
Enum data_type
{
Type_uint8=0 x20,
Type_uint16=0 x21,
X22 type_uint32=0,
Type_string=0 x42,
}
//header files define structure
Strcut attr
{
UINT16 ID;
Enum data_type type;
The union
{
UINT8 data8;
UINT16 data16;
UINT32 data32;
UINT8 dataStr [32].
}
} attr_st;
//gateway information saved in the database
Struct attr_st attrArray [6]=
{
{0 x0000, type_uint8. Data8=0 x12},
{0 x0001 type_uint16,. The data16=0 x1234},
{0 x0002, type_uint32. Data32=0 x12345678},
{0 x0003, type_string, dataStr="I 'm a Light"},
{0 x0004, type_uint16,. The data16=0 x00000011},
{0 x0005, type_string, dataStr="A li ba ba"},
};
Mobile phone APP using json and host communication
Mobile phone APP, install a plug-in, plug-in contains these important information
Variable1 {NAME="switch state," ID=0 x0000, type=type_uint8}
Variable2 {NAME="brightness", ID=0 x0001, type=type_uint16}
Variable3 {NAME="production date", ID=0 x0002, type=type_uint32}
Variable4 {NAME="product model", ID=0 x0003, type=type_string}
Variable5 {NAME="firmware version," ID=0 x0004, type_uint16}
Variable6 {NAME="manufacturers," ID=0 x0005, type=type_string}
Variable7 {NAME="manufacturer's home page," ID=0 x0006, type=type_string}
Mobile phone APP on the interface of this a few function
1, access to the switch state
2, get brightness
3, to obtain product model
4, get manufacturers
5, access to the manufacturer home page
Question:
1, use the Python whether can realize the function of APP on the plugin?
2, after the phone APP running Python plug-in, interface automatic loading plug-ins described in the interface,
3 APP, in accordance with the plug-in described, packaged with Linux host json, obtain the needed parameters, from Linux host
4, note that there is no "ID=0 x0006" in Linux host data, then the APP interface generation, "access to the manufacturer home page a" should be displayed as gray, if the phone connects another Linux host, the host data has {0 x0006, type_string,. DataStr="www.csdn.net"} this term, mobile phone interface has the button "access to the manufacturer home page",
CodePudding user response:
Apple or Google add plug-in does not support the app, because this will avoid platform review/testIn a train of thought, the server generates HTML even pictures, sent to the app
CodePudding user response: