Пишу программу для работы с видеорегистратором BestDVR из под Linux.
Всё общение идёт в формате:
запрос серверу: "Name" : "AlarmFunction", "Ret" : 100, "SessionID" : "0x00000001"
ответ: { "Name" : "SystemFunction", "Ret" : 100, "SessionID" : "0x00000001", "SystemFunction" : { "AlarmFunction" : { "AlarmConfig" : true, "BlindDetect" : true, "LossDetect" : true, "MotionDetect" : true, "NetAbort" : false, "NetAlarm" : true, "NetIpConflict" : false, "StorageFailure" : true, "StorageLowSpace" : true, "StorageNotExist" : true }, "CommFunction" : { "CommRS232" : true, "CommRS485" : true }, "EncodeFunction" : { "CombineStream" : false, "DoubleStream" : true, "SnapStream" : true }, "NetServerFunction" : { "Net3G" : true, "NetARSP" : true, "NetAlarmCenter" : true, "NetDDNS" : true, "NetDHCP" : true, "NetDNS" : true, "NetEmail" : true, "NetFTP" : true, "NetIPFilter" : true, "NetMobile" : true, "NetMutliCast" : false, "NetNTP" : true, "NetPPPoE" : true, "NetPlatMega" : false, "NetPlatShiSou" : false, "NetPlatVVEye" : false, "NetPlatXingWang" : false, "NetRTSP" : true, "NetUPNP" : true, "NetWifi" : true }, "PreviewFunction" : { "GUISet" : true, "Tour" : true } } }
Больно неохота писать свою библиотеку разбора формата. Может кто определит. Если б не разделение запятыми, был бы похож на PHP.
Данные : значение
, - разделитель
"Строки" - строки
true - булевы
100 - числа
{} - массивы
Пользователь решил продолжить мысль 10 Июня 2013, 19:03:51:
На лоре ответили. Это
JSON