Remove config callback from radio driver, it is not part of the
mac device contract anymore. Increment sequence counter and expose
setting transmit power to userspace
@@ -23,12 +23,12 @@ const int COM_COMMIT = 7;
const int EVT_TX = 0;
const int EVT_RX = 1;
-const int EVT_CFG = 2;
int radio_init(void) {
+ // Spin until radio is on
while (!radio_ready()) {}
- return 0;
-} // Do nothing for now
+ return TOCK_SUCCESS;
+}
int rx_result = 0;
int rx_payload_len = 0;
@@ -51,13 +51,6 @@ static void cb_rx(int result,
*((bool*)ud) = true;
}
-static void cb_config(__attribute__ ((unused)) int unused0,
- __attribute__ ((unused)) int unused1,
- __attribute__ ((unused)) int unused2,
- void* ud) {
- *((bool*)ud) = true;
-}
-
// packet contains the payload of the 802.15.4 packet; this will
// be copied into a packet buffer with header space within the kernel.
int radio_send(unsigned short addr, const char* packet, unsigned char len) {
@@ -103,17 +96,7 @@ int radio_set_power(char power) {
}
int radio_commit(void) {
- bool cond = false;
- int err = subscribe(SYS_RADIO, EVT_CFG, cb_config, &cond);
- if (err != TOCK_SUCCESS) {
- return err;
- }
- err = command(SYS_RADIO, COM_COMMIT, 0);
- if (err != TOCK_SUCCESS) {
- return err;
- }
- yield_for(&cond);
- return TOCK_SUCCESS;
+ return command(SYS_RADIO, COM_COMMIT, 0);
}
// Valid channels are 10-26
