Merge pull request #631 from authmillenon/fix-transceiver-types

Fix types in transceiver.c
This commit is contained in:
Oleg Hahm 2014-02-06 12:02:49 +01:00
commit 2499b342bb

View File

@ -118,12 +118,12 @@ static void receive_nativenet_packet(radio_packet_t *trans_p);
void receive_at86rf231_packet(radio_packet_t *trans_p); void receive_at86rf231_packet(radio_packet_t *trans_p);
#endif #endif
static int8_t send_packet(transceiver_type_t t, void *pkt); static int8_t send_packet(transceiver_type_t t, void *pkt);
static int16_t get_channel(transceiver_type_t t); static int32_t get_channel(transceiver_type_t t);
static int16_t set_channel(transceiver_type_t t, void *channel); static int32_t set_channel(transceiver_type_t t, void *channel);
static int16_t get_address(transceiver_type_t t); static int16_t get_address(transceiver_type_t t);
static int16_t set_address(transceiver_type_t t, void *address); static int16_t set_address(transceiver_type_t t, void *address);
static uint16_t get_pan(transceiver_type_t t); static int32_t get_pan(transceiver_type_t t);
static uint16_t set_pan(transceiver_type_t t, void *pan); static int32_t set_pan(transceiver_type_t t, void *pan);
static void set_monitor(transceiver_type_t t, void *mode); static void set_monitor(transceiver_type_t t, void *mode);
static void powerdown(transceiver_type_t t); static void powerdown(transceiver_type_t t);
@ -273,12 +273,12 @@ void run(void)
break; break;
case GET_CHANNEL: case GET_CHANNEL:
*((int16_t *) cmd->data) = get_channel(cmd->transceivers); *((int32_t *) cmd->data) = get_channel(cmd->transceivers);
msg_reply(&m, &m); msg_reply(&m, &m);
break; break;
case SET_CHANNEL: case SET_CHANNEL:
*((int16_t *) cmd->data) = set_channel(cmd->transceivers, cmd->data); *((int32_t *) cmd->data) = set_channel(cmd->transceivers, cmd->data);
msg_reply(&m, &m); msg_reply(&m, &m);
break; break;
@ -304,11 +304,11 @@ void run(void)
switch_to_rx(cmd->transceivers); switch_to_rx(cmd->transceivers);
break; break;
case GET_PAN: case GET_PAN:
*((int16_t*) cmd->data) = get_pan(cmd->transceivers); *((int32_t *) cmd->data) = get_pan(cmd->transceivers);
msg_reply(&m, &m); msg_reply(&m, &m);
break; break;
case SET_PAN: case SET_PAN:
*((int16_t*) cmd->data) = set_pan(cmd->transceivers, cmd->data); *((int32_t *) cmd->data) = set_pan(cmd->transceivers, cmd->data);
msg_reply(&m, &m); msg_reply(&m, &m);
break; break;
#ifdef DBG_IGNORE #ifdef DBG_IGNORE
@ -683,7 +683,7 @@ static int8_t send_packet(transceiver_type_t t, void *pkt)
* *
* @return The radio channel AFTER calling the set command, -1 on error * @return The radio channel AFTER calling the set command, -1 on error
*/ */
static int16_t set_channel(transceiver_type_t t, void *channel) static int32_t set_channel(transceiver_type_t t, void *channel)
{ {
uint8_t c = *((uint8_t *)channel); uint8_t c = *((uint8_t *)channel);
@ -725,7 +725,7 @@ static int16_t set_channel(transceiver_type_t t, void *channel)
* *
* @return The current radio channel of the transceiver, -1 on error * @return The current radio channel of the transceiver, -1 on error
*/ */
static int16_t get_channel(transceiver_type_t t) static int32_t get_channel(transceiver_type_t t)
{ {
switch(t) { switch(t) {
case TRANSCEIVER_CC1100: case TRANSCEIVER_CC1100:
@ -766,7 +766,7 @@ static int16_t get_channel(transceiver_type_t t)
* *
* @return The pan AFTER calling the set command, -1 on error * @return The pan AFTER calling the set command, -1 on error
*/ */
static uint16_t set_pan(transceiver_type_t t, void *pan) { static int32_t set_pan(transceiver_type_t t, void *pan) {
uint16_t c = *((uint16_t*) pan); uint16_t c = *((uint16_t*) pan);
switch (t) { switch (t) {
#ifdef MODULE_CC2420 #ifdef MODULE_CC2420
@ -799,7 +799,7 @@ static uint16_t set_pan(transceiver_type_t t, void *pan) {
* *
* @return The current pan of the transceiver, -1 on error * @return The current pan of the transceiver, -1 on error
*/ */
static uint16_t get_pan(transceiver_type_t t) { static int32_t get_pan(transceiver_type_t t) {
switch (t) { switch (t) {
#ifdef MODULE_CC2420 #ifdef MODULE_CC2420
case TRANSCEIVER_CC2420: case TRANSCEIVER_CC2420: