diff options
author | Gjermund Hodnebrog <gjermund.hodnebrog@stericsson.com> | 2011-06-08 12:46:00 +0200 |
---|---|---|
committer | Sverre Vegge <sverre.vegge@stericsson.com> | 2011-08-03 10:44:58 +0200 |
commit | 520b0447ee8857ade637c6caaeae93ff0360b3c8 (patch) | |
tree | 5c4822e0cb021b5c688cb829d43d45597179948b | |
parent | d05df026508bb1709ca1b02215546d39cd5607c5 (diff) | |
download | u300-520b0447ee8857ade637c6caaeae93ff0360b3c8.tar.gz |
Signed-off-by: Sverre Vegge <sverre.vegge@stericsson.com>
-rw-r--r-- | u300-ril-oem-msg.h | 6 | ||||
-rw-r--r-- | u300-ril-oem-parser.cpp | 14 | ||||
-rw-r--r-- | u300-ril-oem-parser.h | 11 | ||||
-rw-r--r-- | u300-ril-oem.cpp | 24 |
4 files changed, 53 insertions, 2 deletions
diff --git a/u300-ril-oem-msg.h b/u300-ril-oem-msg.h index 53313b1..555597e 100644 --- a/u300-ril-oem-msg.h +++ b/u300-ril-oem-msg.h @@ -45,6 +45,7 @@ enum u300_ril_oem_msg_id { U300_RIL_OEM_MSG_CLOSE_LOGICAL_CHANNEL = 6, U300_RIL_OEM_MSG_UICC_LOGICAL_CHANNEL_ACCESS = 7, U300_RIL_OEM_MSG_SIM_ACCESS = 8, + U300_RIL_OEM_MSG_FAST_DORMANCY = 9, U300_RIL_OEM_MSG_LAST, /* Should be last */ }; @@ -101,4 +102,9 @@ struct u300_ril_oem_sim_access_request { struct u300_ril_oem_sim_access_response { android::String8 response_val_string; }; + +/* fast dormancy */ +/* fast_dormancy_request has no arguments */ +/* fast_dormancy_request has no return value */ + #endif diff --git a/u300-ril-oem-parser.cpp b/u300-ril-oem-parser.cpp index ce3762a..0081daf 100644 --- a/u300-ril-oem-parser.cpp +++ b/u300-ril-oem-parser.cpp @@ -339,6 +339,20 @@ OemRilParser::writeSimAccessResponse(const struct status = writeString(response->response_val_string); return status; } + +android::status_t +OemRilParser::writeFastDormancyResponse() +{ + status_t status; + + status = mParcel.setDataSize(0); + if (status != NO_ERROR) + return status; + + status = writeHeader(U300_RIL_OEM_MSG_FAST_DORMANCY); + return status; +} + /* TODO: Implement new writeXXX methods here */ diff --git a/u300-ril-oem-parser.h b/u300-ril-oem-parser.h index 64e9aad..5023a04 100644 --- a/u300-ril-oem-parser.h +++ b/u300-ril-oem-parser.h @@ -253,7 +253,16 @@ public: * \retval NO_MEMORY indicates memory allocation error. */ status_t writeSimAccessResponse(const struct - u300_ril_oem_sim_access_response *response); + u300_ril_oem_sim_access_response *response); + + /** Build OEM FAST DORMANCY response. + * + * \retval NO_ERROR indicates success. + * \retval BAD_VALUE indicates invalid argument. + * \retval NO_MEMORY indicates memory allocation error. + */ + status_t writeFastDormancyResponse(); + /* TODO: Define new writeXXX methods here */ diff --git a/u300-ril-oem.cpp b/u300-ril-oem.cpp index 7761e57..8c03315 100644 --- a/u300-ril-oem.cpp +++ b/u300-ril-oem.cpp @@ -66,6 +66,8 @@ static android::status_t handleOemRequestUiccLogicalChannelAccess ( u300_ril::OemRilParser &parser, RIL_Errno *ril_errno); static android::status_t handleOemRequestSimAccess( u300_ril::OemRilParser &parser, RIL_Errno *ril_errno); +static android::status_t handleOemRequestFastDormancy( + u300_ril::OemRilParser &parser, RIL_Errno *ril_errno); static void onFrequencyNotification(const char *str); @@ -128,6 +130,9 @@ void requestOEMHookRaw(void *data, size_t datalen, RIL_Token t) case U300_RIL_OEM_MSG_SIM_ACCESS: status = handleOemRequestSimAccess(parser, &ril_errno); break; + case U300_RIL_OEM_MSG_FAST_DORMANCY: + status = handleOemRequestFastDormancy(parser, &ril_errno); + break; default: status = NAME_NOT_FOUND; break; @@ -545,4 +550,21 @@ exit: at_response_free(atresponse); free(cmd); return parser.writeSimAccessResponse(response); -}
\ No newline at end of file +} + +/** + * OEM FAST DORMANCY handler + */ +static android::status_t handleOemRequestFastDormancy( + u300_ril::OemRilParser &parser, RIL_Errno *ril_errno) +{ + int status; + ATResponse *atresponse = NULL; + + status = at_send_command("AT*EFDORM", &atresponse); + if (status < 0 || atresponse->success == 0) + *ril_errno = RIL_E_GENERIC_FAILURE; + at_response_free(atresponse); + + return parser.writeFastDormancyResponse(); +} |