Interface: moteiv.tos.lib.sp.SPSend
interface SPSend
The primary interface for sending a message using SP.
SPSend submits messages (which are composed of packets)
to the SP message pool for transmission. When each link
is available, SP dispatches messages from the pool to the link.
After transmission of the message, a sendDone() event is signalled
with the appropriate error codes.
For multi-packet messages, the SPSendNext interface is used to
acquire the next packet of data. Please see the documentation
within the SPSendNext interface for more information about
message futures.
- Author:
-
Joe Polastre, Moteiv Corporation <info@moteiv.com>
Commands
command result_t cancel(sp_message_t *msg)
command result_t send(sp_message_t *msg, TOS_Msg *tosmsg, sp_address_t addr, uint8_t length)
command result_t sendAdv(sp_message_t *msg, TOS_Msg *tosmsg, sp_device_t dev, sp_address_t addr, uint8_t length, sp_message_flags_t flags, uint8_t quantity)
command result_t update(sp_message_t *msg, TOS_Msg *tosmsg, sp_device_t dev, sp_address_t addr, uint8_t length, sp_message_flags_t flags, uint8_t quantity)
Events
event void sendDone(sp_message_t *msg, sp_message_flags_t flags, sp_error_t error)
Commands - Details
cancel
command result_t cancel(sp_message_t *msg)
- Parameters:
-
msg
- The SP message to remove from the pool
- Returns:
-
SUCCESS if the message is removed or FAIL if the message
is not in the pool or is currently busy.
send
command result_t send(sp_message_t *msg, TOS_Msg *tosmsg, sp_address_t addr, uint8_t length)
- Parameters:
-
msg
- the SP message to send.
-
tosmsg
- the first TOS_Msg packet in the SP message
-
addr
- the destination address of the message
-
length
- the length of the first TOS_Msg
- Returns:
-
SUCCESS if the SP message pool has room to accept the message
sendAdv
command result_t sendAdv(sp_message_t *msg, TOS_Msg *tosmsg, sp_device_t dev, sp_address_t addr, uint8_t length, sp_message_flags_t flags, uint8_t quantity)
- Parameters:
-
msg
- the SP message to send.
-
tosmsg
- the first TOS_Msg packet in the SP message
-
dev
- the destination interface for the message
-
addr
- the destination address of the message
-
length
- the length of the first TOS_Msg
-
flags
- the flags for control information for this message
-
quantity
- the number of packets in the message using SP message futures
- Returns:
-
SUCCESS if the message is accepted into the SP message pool
update
command result_t update(sp_message_t *msg, TOS_Msg *tosmsg, sp_device_t dev, sp_address_t addr, uint8_t length, sp_message_flags_t flags, uint8_t quantity)
- Returns:
-
FAIL if the message is not in the pool or if it is busy
Events - Details
sendDone
event void sendDone(sp_message_t *msg, sp_message_flags_t flags, sp_error_t error)
- Parameters:
-
msg
- the SP message removed from the message pool
-
flags
- feedback from SP to network protocols
-
error
- notification of any errors that the message incurred