You are here: SwitchKit® Development Environment Programmer’s Guide > 7 Message Functions > sk_sendMessageWithTag()

sk_sendMessageWithTag()

Description

The sk_sendMessageWithTag() function takes the results of sk_packMessage() and sends a character buffer with a size to the switch. If no appropriate message structure is available to pass to sk_packMessage(), the character buffer can be filled in manually with the bytes that need to be sent.

This function takes a void pointer called tag as an argument. It can be an arbitrary value and is not used or change by SwitchKit. Upon receipt of an acknowledgment, the value is passed to the HandlerFunc to provide some context associated with the sent message.

This message is also available as sk_sendMessageWithTagOnConnection().

Syntax

int sk_sendMessageWithTag(char *aBuffer, aBufSize,
void *aTag);

int sk_sendMessageWithTagOnConnection(char *aBuffer, aBufSize, void *aTag, int aConID);

Parameters

The function parameters are shown in the table below.

Argument | Description
--- | ---
aBuffer | Pointer to a packed message.
aBufSize | Size of the packed message.
aTag | An application defined pointer which will be returned to the application when a handler is invoked.
aConID | aConID is a connection identifier specified at connection creation time and used to indicate which LLC an application wishes to communicate with.

Return Values

Possible return values for this function:

SK_LOST_LLC | This return value indicates that your application lost contact with the LLC.
SK_UNKNOWN_MSG_ BUF | Buffer and Size pointers do not point to a valid message.
SK_NO_CONNECT_ AVAIL | The specified connection from OnConnection() is not available or valid.