| | |
| | | MasterInqRoadStatus(); |
| | | break; |
| | | } |
| | | case ID_MS_BLUETOOTH_NAME: { |
| | | Document doc; |
| | | doc.Parse(value); |
| | | if (!doc.HasParseError()) { |
| | | if (doc.HasMember("bluetooth_name") && doc.HasMember("bluetooth_addr")) { |
| | | const Value& s1 = doc["bluetooth_name"]; |
| | | const Value& s2 = doc["bluetooth_addr"]; |
| | | SetRemoteBluetooth(s1.GetString(), s2.GetString()); |
| | | } else if (doc.HasMember("bluetooth_addr")) { |
| | | const Value& s = doc["bluetooth_addr"]; |
| | | SetRemoteBluetooth(NULL, s.GetString()); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | default:break; |
| | | } |
| | | } |
| | |
| | | SendMsgToMainProcIndep(ID_SM_LIGHT_EXAM_REQ, NULL); |
| | | } |
| | | |
| | | void MA_SendBlueStatus(int status) |
| | | void MA_SendBlueStatus(const char *name, const char *addr, int status) |
| | | { |
| | | StringBuffer sb; |
| | | Writer<StringBuffer> writer(sb); |
| | | |
| | | writer.StartObject(); |
| | | |
| | | if (name != NULL) { |
| | | writer.Key("bluetooth_name"); |
| | | writer.String(name); |
| | | } |
| | | if (addr != NULL) { |
| | | writer.Key("bluetooth_addr"); |
| | | writer.String(addr); |
| | | } |
| | | |
| | | writer.Key("bluetooth_status"); |
| | | writer.Int(status); |
| | | writer.EndObject(); |