diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-06-27 08:13:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-27 08:13:35 +0000 |
commit | 4c23d0acaebb81b32ca576193b1e2ee777e08f33 (patch) | |
tree | e632d3088f52ef74174d1cf4e3cca114131786ef | |
parent | 9c7ad93840f7e21adf9fbcf0d23b1d4c69ee9fab (diff) | |
parent | ec94b828fe29a51c5fc4afa542e3f4430d2e238b (diff) | |
download | android_hardware_ril-4c23d0acaebb81b32ca576193b1e2ee777e08f33.tar.gz android_hardware_ril-4c23d0acaebb81b32ca576193b1e2ee777e08f33.tar.bz2 android_hardware_ril-4c23d0acaebb81b32ca576193b1e2ee777e08f33.zip |
Merge "Keepalive RIL Interface" into oc-dr1-dev
-rw-r--r-- | include/telephony/ril.h | 74 | ||||
-rw-r--r-- | libril/ril_service.cpp | 16 |
2 files changed, 90 insertions, 0 deletions
diff --git a/include/telephony/ril.h b/include/telephony/ril.h index 31126ef..dfca7cb 100644 --- a/include/telephony/ril.h +++ b/include/telephony/ril.h @@ -6263,6 +6263,43 @@ typedef struct { */ #define RIL_REQUEST_STOP_NETWORK_SCAN 143 +/** + * RIL_REQUEST_START_KEEPALIVE + * + * Start a keepalive session + * + * Request that the modem begin sending keepalive packets on a particular + * data call, with a specified source, destination, and format. + * + * "data" is a const RIL_RequestKeepalive + * "response" is RIL_KeepaliveStatus with a valid "handle" + * + * Valid errors: + * SUCCESS + * NO_RESOURCES + * INVALID_ARGUMENTS + * + */ +#define RIL_REQUEST_START_KEEPALIVE 144 + +/** + * RIL_REQUEST_STOP_KEEPALIVE + * + * Stops an ongoing keepalive session + * + * Requests that a keepalive session with the given handle be stopped. + * there is no parameter for this request. + * + * "data" is an integer handle + * "response" is NULL + * + * Valid errors: + * SUCCESS + * INVALID_ARGUMENTS + * + */ +#define RIL_REQUEST_STOP_KEEPALIVE 145 + /***********************************************************************/ /** @@ -6939,6 +6976,14 @@ typedef struct { */ #define RIL_UNSOL_NETWORK_SCAN_RESULT 1049 +/** + * RIL_UNSOL_KEEPALIVE_STATUS + * + * "data" is NULL + * "response" is a const RIL_KeepaliveStatus * + */ +#define RIL_UNSOL_KEEPALIVE_STATUS 1050 + /***********************************************************************/ @@ -7099,6 +7144,35 @@ typedef struct { loosely defined in LTE Layer 3 spec 24.008 */ } RIL_PCO_Data; +typedef enum { + NATT_IPV4 = 0, /* Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 */ + NATT_IPV6 = 1 /* Keepalive specified by RFC 3948 Sec. 2.3 using IPv6 */ +} RIL_KeepaliveType; + +#define MAX_INADDR_LEN 16 +typedef struct { + RIL_KeepaliveType type; /* Type of keepalive packet */ + char sourceAddress[MAX_INADDR_LEN]; /* Source address in network-byte order */ + int sourcePort; /* Source port if applicable, or 0x7FFFFFFF; + the maximum value is 65535 */ + char destinationAddress[MAX_INADDR_LEN]; /* Destination address in network-byte order */ + int destinationPort; /* Destination port if applicable or 0x7FFFFFFF; + the maximum value is 65535 */ + int maxKeepaliveIntervalMillis; /* Maximum milliseconds between two packets */ + int cid; /* Context ID, uniquely identifies this call */ +} RIL_KeepaliveRequest; + +typedef enum { + KEEPALIVE_ACTIVE, /* Keepalive session is active */ + KEEPALIVE_INACTIVE, /* Keepalive session is inactive */ + KEEPALIVE_PENDING /* Keepalive session status not available */ +} RIL_KeepaliveStatusCode; + +typedef struct { + uint32_t sessionHandle; + RIL_KeepaliveStatusCode code; +} RIL_KeepaliveStatus; + #ifdef RIL_SHLIB struct RIL_Env { /** diff --git a/libril/ril_service.cpp b/libril/ril_service.cpp index a2bede4..e8d67cd 100644 --- a/libril/ril_service.cpp +++ b/libril/ril_service.cpp @@ -42,6 +42,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::hidl_array; using ::android::hardware::radio::V1_1::NetworkScanRequest; +using ::android::hardware::radio::V1_1::KeepaliveRequest; using ::android::hardware::Void; using android::CommandInfo; using android::RequestInfo; @@ -439,6 +440,10 @@ struct RadioImpl : public V1_1::IRadio { Return<void> setIndicationFilter(int32_t serial, int32_t indicationFilter); + Return<void> startKeepalive(int32_t serial, const KeepaliveRequest& keepalive); + + Return<void> stopKeepalive(int32_t serial, int32_t sessionHandle); + Return<void> setSimCardPower(int32_t serial, bool powerUp); Return<void> setSimCardPower_1_1(int32_t serial, const V1_1::CardPowerState state); @@ -2839,6 +2844,17 @@ Return<void> RadioImpl::setCarrierInfoForImsiEncryption(int32_t serial, return Void(); } +Return<void> RadioImpl::startKeepalive(int32_t serial, const KeepaliveRequest& keepalive) { + RLOGD("startKeepalive: serial %d", serial); + return Void(); +} + +Return<void> RadioImpl::stopKeepalive(int32_t serial, int32_t sessionHandle) { + RLOGD("stopKeepalive: serial %d", serial); + return Void(); +} + + /*************************************************************************************************** * RESPONSE FUNCTIONS * Functions above are used for requests going from framework to vendor code. The ones below are |