diff options
Diffstat (limited to 'ril/libril/ril.cpp')
-rw-r--r-- | ril/libril/ril.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/ril/libril/ril.cpp b/ril/libril/ril.cpp index ec50701..9f30999 100644 --- a/ril/libril/ril.cpp +++ b/ril/libril/ril.cpp @@ -300,6 +300,8 @@ static int responseHardwareConfig(Parcel &p, void *response, size_t responselen) static int responseDcRtInfo(Parcel &p, void *response, size_t responselen); static int responseRadioCapability(Parcel &p, void *response, size_t responselen); static int responseSSData(Parcel &p, void *response, size_t responselen); +static int responseLceStatus(Parcel &p, void *response, size_t responselen); +static int responseLceData(Parcel &p, void *response, size_t responselen); static int decodeVoiceRadioTechnology (RIL_RadioState radioState); static int decodeCdmaSubscriptionSource (RIL_RadioState radioState); @@ -3740,6 +3742,59 @@ static int responseDcRtInfo(Parcel &p, void *response, size_t responselen) return 0; } +static int responseLceStatus(Parcel &p, void *response, size_t responselen) { + if (response == NULL || responselen != sizeof(RIL_LceStatusInfo)) { + if (response == NULL) { + RLOGE("invalid response: NULL"); + } + else { + RLOGE("responseLceStatus: invalid response length %d expecting len: d%", + sizeof(RIL_LceStatusInfo), responselen); + } + return RIL_ERRNO_INVALID_RESPONSE; + } + + RIL_LceStatusInfo *p_cur = (RIL_LceStatusInfo *)response; + p.write((void *)p_cur, 1); // p_cur->lce_status takes one byte. + p.writeInt32(p_cur->actual_interval_ms); + + startResponse; + appendPrintBuf("LCE Status: %d, actual_interval_ms: %d", + p_cur->lce_status, p_cur->actual_interval_ms); + closeResponse; + + return 0; +} + +static int responseLceData(Parcel &p, void *response, size_t responselen) { + if (response == NULL || responselen != sizeof(RIL_LceDataInfo)) { + if (response == NULL) { + RLOGE("invalid response: NULL"); + } + else { + RLOGE("responseLceData: invalid response length %d expecting len: d%", + sizeof(RIL_LceDataInfo), responselen); + } + return RIL_ERRNO_INVALID_RESPONSE; + } + + RIL_LceDataInfo *p_cur = (RIL_LceDataInfo *)response; + p.writeInt32(p_cur->last_hop_capacity_kbps); + + /* p_cur->confidence_level and p_cur->lce_suspended take 1 byte each.*/ + p.write((void *)&(p_cur->confidence_level), 1); + p.write((void *)&(p_cur->lce_suspended), 1); + + startResponse; + appendPrintBuf("LCE info received: capacity %d confidence level %d + and suspended %d", + p_cur->last_hop_capacity_kbps, p_cur->confidence_level, + p_cur->lce_suspended); + closeResponse; + + return 0; +} + /** * A write on the wakeup fd is done just to pop us out of select() * We empty the buffer here and then ril_event will reset the timers on the |