Merge "LOC_API: Modify LOC_API to support MSAPU client."
This commit is contained in:
commit
40f4d0d40d
6 changed files with 42 additions and 1 deletions
|
@ -1661,7 +1661,8 @@ static void loc_eng_deferred_action_thread(void* arg)
|
|||
{
|
||||
loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg;
|
||||
if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC ||
|
||||
wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM) {
|
||||
wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM ||
|
||||
wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU) {
|
||||
AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif;
|
||||
WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId);
|
||||
stateMachine->subscribeRsrc((Subscriber*)&subscriber);
|
||||
|
|
12
loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp
Normal file → Executable file
12
loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp
Normal file → Executable file
|
@ -48,11 +48,13 @@ static int loc_api_server_msgqid;
|
|||
static int loc_api_resp_msgqid;
|
||||
static int quipc_msgqid;
|
||||
static int msapm_msgqid;
|
||||
static int msapu_msgqid;
|
||||
|
||||
static const char * global_loc_api_q_path = GPSONE_LOC_API_Q_PATH;
|
||||
static const char * global_loc_api_resp_q_path = GPSONE_LOC_API_RESP_Q_PATH;
|
||||
static const char * global_quipc_ctrl_q_path = QUIPC_CTRL_Q_PATH;
|
||||
static const char * global_msapm_ctrl_q_path = MSAPM_CTRL_Q_PATH;
|
||||
static const char * global_msapu_ctrl_q_path = MSAPU_CTRL_Q_PATH;
|
||||
|
||||
static int loc_api_server_proc_init(void *context)
|
||||
{
|
||||
|
@ -81,6 +83,7 @@ static int loc_api_server_proc_init(void *context)
|
|||
loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR);
|
||||
quipc_msgqid = loc_eng_dmn_conn_glue_msgget(global_quipc_ctrl_q_path, O_RDWR);
|
||||
msapm_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapm_ctrl_q_path , O_RDWR);
|
||||
msapu_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapu_ctrl_q_path , O_RDWR);
|
||||
|
||||
LOC_LOGD("%s:%d] loc_api_server_msgqid = %d\n", __func__, __LINE__, loc_api_server_msgqid);
|
||||
return 0;
|
||||
|
@ -148,6 +151,7 @@ static int loc_api_server_proc_post(void *context)
|
|||
loc_eng_dmn_conn_glue_msgremove( global_loc_api_resp_q_path, loc_api_resp_msgqid);
|
||||
loc_eng_dmn_conn_glue_msgremove( global_quipc_ctrl_q_path, quipc_msgqid);
|
||||
loc_eng_dmn_conn_glue_msgremove( global_msapm_ctrl_q_path, msapm_msgqid);
|
||||
loc_eng_dmn_conn_glue_msgremove( global_msapu_ctrl_q_path, msapu_msgqid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -221,6 +225,14 @@ int loc_eng_dmn_conn_loc_api_server_data_conn(int sender_id, int status) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU: {
|
||||
LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU", __func__, __LINE__);
|
||||
if (loc_eng_dmn_conn_glue_msgsnd(msapu_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) {
|
||||
LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON: {
|
||||
LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON", __func__, __LINE__);
|
||||
if (loc_eng_dmn_conn_glue_msgsnd(loc_api_resp_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) {
|
||||
|
|
2
loc_api/libloc_api_50001/loc_eng_dmn_conn.h
Normal file → Executable file
2
loc_api/libloc_api_50001/loc_eng_dmn_conn.h
Normal file → Executable file
|
@ -37,6 +37,7 @@
|
|||
#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q"
|
||||
#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q"
|
||||
#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q"
|
||||
#define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q"
|
||||
|
||||
#else
|
||||
|
||||
|
@ -44,6 +45,7 @@
|
|||
#define GPSONE_LOC_API_RESP_Q_PATH "/tmp/gpsone_loc_api_resp_q"
|
||||
#define QUIPC_CTRL_Q_PATH "/tmp/quipc_ctrl_q"
|
||||
#define MSAPM_CTRL_Q_PATH "/tmp/msapm_ctrl_q"
|
||||
#define MSAPU_CTRL_Q_PATH "/tmp/msapu_ctrl_q"
|
||||
|
||||
#endif
|
||||
|
||||
|
|
24
loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp
Normal file → Executable file
24
loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp
Normal file → Executable file
|
@ -99,6 +99,18 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg,
|
|||
loc_eng_msg_sender(loc_api_handle, msg);
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_SENDER_ID_MSAPU:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU");
|
||||
loc_eng_msg_request_wifi *msg(
|
||||
new loc_eng_msg_request_wifi(loc_api_handle,
|
||||
type,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
|
||||
(char*)pmsg->cmsg.cmsg_if_request.ssid,
|
||||
(char*)pmsg->cmsg.cmsg_if_request.password));
|
||||
loc_eng_msg_sender(loc_api_handle, msg);
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_SENDER_ID_GPSONE_DAEMON:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON");
|
||||
|
@ -179,6 +191,18 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg,
|
|||
loc_eng_msg_sender(loc_api_handle, msg);
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_SENDER_ID_MSAPU:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU");
|
||||
loc_eng_msg_release_wifi *msg(
|
||||
new loc_eng_msg_release_wifi(loc_api_handle,
|
||||
type,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
|
||||
(char*)pmsg->cmsg.cmsg_if_request.ssid,
|
||||
(char*)pmsg->cmsg.cmsg_if_request.password));
|
||||
loc_eng_msg_sender(loc_api_handle, msg);
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_SENDER_ID_GPSONE_DAEMON:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON");
|
||||
|
|
1
loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h
Normal file → Executable file
1
loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h
Normal file → Executable file
|
@ -67,6 +67,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
IF_REQUEST_SENDER_ID_QUIPC = 0,
|
||||
IF_REQUEST_SENDER_ID_MSAPM,
|
||||
IF_REQUEST_SENDER_ID_MSAPU,
|
||||
IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
|
||||
IF_REQUEST_SENDER_ID_MODEM
|
||||
} ctrl_if_req_sender_id_e_type;
|
||||
|
|
|
@ -136,6 +136,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_MODEM,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_UNKNOWN
|
||||
|
|
Loading…
Reference in a new issue