| | |
| | | |
| | | #define PARSE_BUFF_SIZE 4096 |
| | | |
| | | const char *VK_REG = "platform_register"; |
| | | #define DEBUG(fmt, args...) LOGD("<platform> <%s>: " fmt, __func__, ##args) |
| | | |
| | | struct platformSocket { |
| | | char domain_name[32]; |
| | |
| | | |
| | | void InitPlatform(const uint8_t *phone, const char *domain_name, int port) |
| | | { |
| | | DEBUG("InitPlatform"); |
| | | |
| | | pthread_mutex_init(&platform_tx_mutex, NULL); |
| | | pthread_mutex_init(&events_mutex, NULL); |
| | | |
| | |
| | | pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);//detached |
| | | pthread_create(&pid, &attr, StatusListenThread, NULL); |
| | | |
| | | MA_ReqRtkPlatformConfig(); |
| | | AppTimer_add(ReqRtkPlatformConfigTimeout, D_SEC(2)); |
| | | MA_ReqRtkPlatformConfig(); |
| | | } |
| | | |
| | | static void ReqRtkPlatformConfigTimeout(union sigval sig) |
| | | { |
| | | AppTimer_delete(ReqRtkPlatformConfigTimeout); |
| | | MA_ReqRtkPlatformConfig(); |
| | | |
| | | AppTimer_add(ReqRtkPlatformConfigTimeout, D_SEC(2)); |
| | | MA_ReqRtkPlatformConfig(); |
| | | } |
| | | |
| | | void ConfigPlatform(const rtk_platform_cfg_t *p) |