From d396d75d551ae6e3686c8174de3a4fc609b27a68 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 Jan 2018 14:53:26 +0100 Subject: [PATCH] pkg/openthread: update to use iolists --- pkg/openthread/contrib/platform_radio.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/openthread/contrib/platform_radio.c b/pkg/openthread/contrib/platform_radio.c index 27487e3670..8095bb6580 100644 --- a/pkg/openthread/contrib/platform_radio.c +++ b/pkg/openthread/contrib/platform_radio.c @@ -297,14 +297,15 @@ void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower) ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket) { (void) aInstance; - struct iovec pkt; - /* Populate iovec with transmit data + /* Populate iolist with transmit data * Unlike RIOT, OpenThread includes two bytes FCS (0x00 0x00) so * these bytes are removed */ - pkt.iov_base = aPacket->mPsdu; - pkt.iov_len = aPacket->mLength - RADIO_IEEE802154_FCS_LEN; + iolist_t iolist = { + .iol_base = aPacket->mPsdu, + .iol_len = (aPacket->mLength - RADIO_IEEE802154_FCS_LEN) + }; /*Set channel and power based on transmit frame */ DEBUG("otPlatRadioTransmit->channel: %i, length %d\n", (int) aPacket->mChannel, (int)aPacket->mLength); @@ -316,7 +317,7 @@ ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket) _set_power(aPacket->mPower); /* send packet though netdev */ - _dev->driver->send(_dev, &pkt, 1); + _dev->driver->send(_dev, &iolist); return kThreadError_None; }