TransferChanMsg

Type

SwitchKit API message

Description

Use the SK_TransferChanMsg message when an application requires a different application to receive messages associated with a channel.

Span and channel describe the channel that is to be transferred to the target application. This channel must already be assigned to the current application. The Tag and Data fields are passed along without modification. The target application receives SK_TransferChanMsg with all the fields entered as they were entered by the sending application. The target application is then responsible for returning the channel to the LLC when it is finished with it.

Important! The span and channel must be specified in both the TransferChanMsg and the TransferChanMsgAck in order for the LLC to properly route this message to the appropriate applications. The channel is not physically transferred to the new application until the requesting application receives the Ack.

The application that receives the message must send a SK_TransferChanMsgAck to let the sending application know that the message was received. This can be done with the following code:

int handleTransfer(SK_Event *evt, void *tag){

MsgStruct *msg = evt->IncomingMsg;

SK_MSG_SWITCH(msg) {

CASE_TransferChanMsg(tcm) {

SK_TransferChanMsgAck a;

sk_initMsg(&a,TAG_TransferChanMsgAck);

a.Status = 0x10;

sk_setSeqNum(&a,sk_getSeqNum(tcm));

sk_sendMsgStruct((MsgStruct *)&a, NULL, NULL);

};

};

};

Sent by

Application

C Structure

typedef struct {

unsigned short Span;

UBYTE Channel;

int Target;

unsigned short AckTimeout;

int Tag1;

int Tag2;

int Tag3;

int Tag4;

char AppGroupTarget[16];

unsigned short DataSize;

UBYTE Data[210];

} SK_TransferChanMsg;

C Structure Response

typedef struct {

int Status;

unsigned short Span;

UBYTE Channel;

unsigned short AckTimeout;

int Tag1;

int Tag2;

int Tag3;

int Tag4;

unsigned short DataSize;

UBYTE Data[226];

} SK_TransferChanMsgAck;

C++ Class

class SKC_TransferChanMsg : public SKC_ToolkitMessage {

public:

unsigned short getSpan() const;

void setSpan(unsigned short x);

UBYTE getChannel() const;

void setChannel(UBYTE x);

int getTarget() const;

void setTarget(int x);

unsigned short getAckTimeout() const;

void setAckTimeout(unsigned short x);

int getTag1() const;

void setTag1(int x);

int getTag2() const;

void setTag2(int x);

int getTag3() const;

void setTag3(int x);

int getTag4() const;

void setTag4(int x);

const char *getAppGroupTarget() const;

void setAppGroupTarget(const char *x);

unsigned short getDataSize() const;

void setDataSize(unsigned short x);

const UBYTE *getData() const;

UBYTE *getData();

void setData(UBYTE *x);

};

C++ Class Response

class SKC_TransferChanMsgAck : public SKC_ToolkitAck {

public:

int getStatus() const;

void setStatus(int x);

unsigned short getSpan() const;

void setSpan(unsigned short x);

UBYTE getChannel() const;

void setChannel(UBYTE x);

unsigned short getAckTimeout() const;

void setAckTimeout(unsigned short x);

int getTag1() const;

void setTag1(int x);

int getTag2() const;

void setTag2(int x);

int getTag3() const;

void setTag3(int x);

int getTag4() const;

void setTag4(int x);

unsigned short getDataSize() const;

void setDataSize(unsigned short x);

const UBYTE *getData() const;

UBYTE *getData();

void setData(UBYTE *x);

};

SK_BAD_APP_NAME

Target application does not exist.

SK_BAD_PARAMETER

Invalid parameter. This includes when the channel specified by span and channel is not allocated to the source application.

SK_BAD_MESSAGE

LLC is unable to send the TransferCan Msg to the target application.