|
|
| version 1.1.2.4, 2011/11/23 08:50:03 | version 1.1.2.11, 2011/11/29 22:42:23 |
|---|---|
| Line 4 | Line 4 |
| static void *acc_rtlm, *pub_rtlm, *log_rtlm; | static void *acc_rtlm, *pub_rtlm, *log_rtlm; |
| struct tagCallbacks call; | |
| /* | /* |
| * mqttLog() Log message to syslog | * mqttLog() Log message to syslog |
| * | * |
| Line 73 mqttLoadRTLM(sl_config *cfg, int modtype) | Line 75 mqttLoadRTLM(sl_config *cfg, int modtype) |
| switch (modtype) { | switch (modtype) { |
| case 0: | case 0: |
| acc_rtlm = rtlm; | acc_rtlm = rtlm; |
| mqttOpenACC = mqttOpenRTLM; | call.OpenACC = mqttOpenRTLM; |
| mqttCloseACC = mqttCloseRTLM; | call.CloseACC = mqttCloseRTLM; |
| call.LoginACC = dlsym(rtlm, "mqtt_rtlm_login"); | |
| if (!call.LoginACC) { | |
| mqttLog("Error:: incorrect module ...\n"); | |
| dlclose(rtlm); | |
| return NULL; | |
| } | |
| break; | break; |
| case 1: | case 1: |
| pub_rtlm = rtlm; | pub_rtlm = rtlm; |
| mqttOpenPUB = mqttOpenRTLM; | call.OpenPUB = mqttOpenRTLM; |
| mqttClosePUB = mqttCloseRTLM; | call.ClosePUB = mqttCloseRTLM; |
| call.InitSessPUB = dlsym(rtlm, "mqtt_rtlm_init_session"); | |
| call.FiniSessPUB = dlsym(rtlm, "mqtt_rtlm_fini_session"); | |
| call.ChkSessPUB = dlsym(rtlm, "mqtt_rtlm_chk_session"); | |
| call.WritePUB = dlsym(rtlm, "mqtt_rtlm_write_topic"); | |
| call.ReadPUB = dlsym(rtlm, "mqtt_rtlm_read_topic"); | |
| call.DeletePUB = dlsym(rtlm, "mqtt_rtlm_delete_topic"); | |
| if (!call.InitSessPUB || !call.FiniSessPUB || !call.ChkSessPUB || | |
| !call.WritePUB || !call.ReadPUB || !call.DeletePUB) { | |
| mqttLog("Error:: incorrect module ...\n"); | |
| dlclose(rtlm); | |
| return NULL; | |
| } | |
| break; | break; |
| default: | default: |
| log_rtlm = rtlm; | log_rtlm = rtlm; |
| mqttOpenLOG = mqttOpenRTLM; | call.OpenLOG = mqttOpenRTLM; |
| mqttCloseLOG = mqttCloseRTLM; | call.CloseLOG = mqttCloseRTLM; |
| call.LOG = dlsym(rtlm, "mqtt_rtlm_logger"); | |
| if (!call.LOG) { | |
| mqttLog("Error:: incorrect module ...\n"); | |
| dlclose(rtlm); | |
| return NULL; | |
| } | |
| break; | break; |
| } | } |