diff options
Diffstat (limited to 'src/sim.c')
-rw-r--r-- | src/sim.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -1720,6 +1720,40 @@ void ofono_sim_set_ready(struct ofono_sim *sim) } } +static void sim_cb_download_cb(const struct ofono_error *error, + const unsigned char *data, int len, void *user) +{ + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { + ofono_error("CellBroadcast download to UICC failed"); + return; + } + + ofono_debug("CellBroadcast download to UICC reported no error"); +} + +void __ofono_cbs_sim_download(struct ofono_sim *sim, + const guint8 *pdu, int pdu_len) +{ + guint8 tlv[pdu_len + 8]; + + if (sim->ready != TRUE) + return; + if (!sim->driver->envelope) + return; + + tlv[0] = 0xd2; /* Cell Broadcast Download */ + tlv[1] = 6 + pdu_len; + tlv[2] = 0x82; /* Device Identities */ + tlv[3] = 0x02; /* Device Identities length */ + tlv[4] = 0x83; /* Network */ + tlv[5] = 0x81; /* UICC */ + tlv[6] = 0x8c; /* Cell Broadcast page */ + tlv[7] = pdu_len; + memcpy(tlv + 8, pdu, pdu_len); + + sim->driver->envelope(sim, pdu_len + 8, tlv, sim_cb_download_cb, sim); +} + int ofono_sim_driver_register(const struct ofono_sim_driver *d) { DBG("driver: %p, name: %s", d, d->name); |