ProviewR Programmer's Reference Manual  V6.1.4
Functions

Functions

int qcom_AidCompare (const qcom_sAid *a1, const qcom_sAid *a2)
 Compare two application identities;. More...
 
pwr_tBoolean qcom_AidIsEqual (const qcom_sAid *a1, const qcom_sAid *a2)
 Test if two application identities are equal. More...
 
pwr_tBoolean qcom_AidIsNotEqual (const qcom_sAid *a1, const qcom_sAid *a2)
 Test if two application identities are different. More...
 
pwr_tBoolean qcom_AidIsNotNull (const qcom_sAid *a)
 Test if application identity is not null. More...
 
pwr_tBoolean qcom_AidIsNull (const qcom_sAid *a)
 Test if application identity is null. More...
 
void * qcom_Alloc (pwr_tStatus *sts, unsigned int size)
 Allocate a buffer in the qcom pool.
 
pwr_tBoolean qcom_AttachQ (pwr_tStatus *sts, const qcom_sQid *qid)
 Attach to an allready created queue.
 
pwr_tBoolean qcom_Bind (pwr_tStatus *sts, const qcom_sQid *myQ, const qcom_sQid *toQ)
 Bind one queue to another. More...
 
pwr_tBoolean qcom_CreateQ (pwr_tStatus *sts, qcom_sQid *myQ, qcom_sQattr *attr, const char *qname)
 Create a queue and make an implicit connect to it.
 
pwr_tBoolean qcom_DeleteQ (pwr_tStatus *sts, const qcom_sQid *myQ)
 Delete a queue. Delete a queue and release all resources held by the queue.
 
pwr_tBoolean qcom_WaitAnd (pwr_tStatus *status, const qcom_sQid *qid, const qcom_sQid *eid, int mask, int tmo)
 Wait for an event or a message. More...
 
pwr_tBoolean qcom_WaitOr (pwr_tStatus *status, const qcom_sQid *qid, const qcom_sQid *eid, int mask, int tmo, int *event)
 Wait for an event or a message. More...
 
pwr_tBoolean qcom_Exit (pwr_tStatus *sts)
 Disconnect from QCom. Disconnects an application from the Qcom message bus, all resources such as, queue, messages andbindings, held by the application will be released.
 
pwr_tBoolean qcom_Free (pwr_tStatus *sts, void *buffer)
 Free a previously allocated buffer.
 
pwr_tBoolean qcom_Init (pwr_tStatus *sts, qcom_sAid *aid, const char *aname)
 Connect to QCom. More...
 
void * qcom_Get (pwr_tStatus *sts, const qcom_sQid *myQ, qcom_sGet *get, int tmo_ms)
 Get a new message. More...
 
qcom_tBus qcom_MyBus (pwr_tStatus *sts)
 Get the current qcom bus number.
 
pwr_tBoolean qcom_MyNode (pwr_tStatus *sts, qcom_sNode *node)
 Get the local qcom node.
 
char * qcom_NodeName (pwr_tNodeId nid)
 Get the name of a qcom node.
 
pwr_tBoolean qcom_Node (pwr_tStatus *sts, qcom_sNode *node, pwr_tNodeId nid)
 Get qcom node from node identity.
 
pwr_tBoolean qcom_NextNode (pwr_tStatus *sts, qcom_sNode *node, pwr_tNodeId nid)
 Get the next qcom node. If nid is pwr_cNNodeId the first node is returned. More...
 
pwr_tBoolean qcom_Put (pwr_tStatus *sts, const qcom_sQid *receiver, qcom_sPut *put)
 Put a new message. More...
 
int qcom_QidCompare (const qcom_sQid *q1, const qcom_sQid *q2)
 Compare two queue identities;. More...
 
pwr_tBoolean qcom_QidIsEqual (const qcom_sQid *q1, const qcom_sQid *q2)
 Test if two queue identities are equal. More...
 
pwr_tBoolean qcom_QidIsNotEqual (const qcom_sQid *q1, const qcom_sQid *q2)
 Test if two queue identities are different. More...
 
pwr_tBoolean qcom_QidIsNull (const qcom_sQid *q)
 Test if queue identity is null. More...
 
pwr_tBoolean qcom_QidIsNotNull (const qcom_sQid *q)
 Test if queue identity is not null. More...
 
char * qcom_QidToString (char *s, qcom_sQid *qid, int prefix)
 Converts a queue identifier, 'qid' to a string. More...
 
pwr_tBoolean qcom_Reply (pwr_tStatus *sts, qcom_sGet *get, qcom_sPut *put)
 Reply to a qcom_Request. The qcom_Reply() call looks almost like a qcom_Put(), but the queue id is replaced with a qcom_sGet. Applications must agree on using qcom_Request/qcom_Reply, using a qcom_Put to reply on a qcom_Request will not work.
 
void * qcom_Request (pwr_tStatus *sts, const qcom_sQid *receiver, qcom_sPut *put, const qcom_sQid *myQ, qcom_sGet *get, int tmo_ms, pwr_tBitMask flags)
 Put a request and return the reply. More...
 
pwr_tBoolean qcom_Unbind (pwr_tStatus *sts, const qcom_sQid *myQ, const qcom_sQid *fromQ)
 Disconnect a target queue from a bound source queue. More...
 
void qcom_LinkConnect (pwr_tNodeId nid)
 
void qcom_LinkDisconnect (pwr_tNodeId nid)
 

Detailed Description

Function Documentation

◆ qcom_AidCompare()

int qcom_AidCompare ( const qcom_sAid a1,
const qcom_sAid a2 
)

Compare two application identities;.

return <0 if aid_1 < aid_2
return 0 if aid_1 == aid_2
return >0 if aid_1 > aid_2.

Returns
int

Definition at line 932 of file rt_qcom.c.

References qcom_sAid::aix, and qcom_sAid::nid.

◆ qcom_AidIsEqual()

pwr_tBoolean qcom_AidIsEqual ( const qcom_sAid a1,
const qcom_sAid a2 
)

Test if two application identities are equal.

return true if aid_1 == aid_2
return false if aid_1 != aid_2.

Returns
pwr_tBoolean

Definition at line 955 of file rt_qcom.c.

References qcom_sAid::aix, and qcom_sAid::nid.

◆ qcom_AidIsNotEqual()

pwr_tBoolean qcom_AidIsNotEqual ( const qcom_sAid a1,
const qcom_sAid a2 
)

Test if two application identities are different.

return true if aid_1 != aid_2
return false if aid_1 == aid_2.

Returns
pwr_tBoolean

Definition at line 968 of file rt_qcom.c.

References qcom_sAid::aix, and qcom_sAid::nid.

◆ qcom_AidIsNotNull()

pwr_tBoolean qcom_AidIsNotNull ( const qcom_sAid a)

Test if application identity is not null.

return true if aid != qcom_cNAid
return false if aid == qcom_cNAid.

Returns
pwr_tBoolean

Definition at line 993 of file rt_qcom.c.

References qcom_sAid::nid.

◆ qcom_AidIsNull()

pwr_tBoolean qcom_AidIsNull ( const qcom_sAid a)

Test if application identity is null.

return true if aid == qcom_cNAid
return false if aid != qcom_cNAid.

Returns
pwr_tBoolean

Definition at line 981 of file rt_qcom.c.

References qcom_sAid::nid.

◆ qcom_Bind()

pwr_tBoolean qcom_Bind ( pwr_tStatus status,
const qcom_sQid tqid,
const qcom_sQid sqid 
)

Bind one queue to another.

A private queue can be bound to one or many forward queues.

Definition at line 171 of file rt_qcom.c.

◆ qcom_Get()

void* qcom_Get ( pwr_tStatus status,
const qcom_sQid qid,
qcom_sGet gp,
int  tmo 
)

Get a new message.

If mp == NULL => pass the address to the buffer in the pool. If mp != NULL => copy the contents to mp and mp->data free the pool buffer. You may only read from a non bound, non forwarded, owned qeueue.

Returns
void*

Definition at line 398 of file rt_qcom.c.

◆ qcom_Init()

pwr_tBoolean qcom_Init ( pwr_tStatus status,
qcom_sAid aid,
const char *  aname 
)

Connect to QCom.

Before using Qcom an application must connect to Qcom. The application has an identity and name. The identity is generated by Qcom and is returned in 'aid'. If 'name' is a null pointer the application will be given the name 'unknown name'. Every message sent from an application contains the application identity and the identity can be read by the receiving application.

Applications using GDH, MH_APPL or MH_OUTUNIT do not have to call qcom_Init(), it is done inside the gdh_Init() and mh_OutunitConnect() calls.

Definition at line 643 of file rt_qcom.c.

◆ qcom_LinkConnect()

void qcom_LinkConnect ( pwr_tNodeId  nid)

Send a connect action message to rt_qmon

Definition at line 1382 of file rt_qcom.c.

◆ qcom_LinkDisconnect()

void qcom_LinkDisconnect ( pwr_tNodeId  nid)

Send a disconnect action message to rt_qmon

Definition at line 1402 of file rt_qcom.c.

◆ qcom_NextNode()

pwr_tBoolean qcom_NextNode ( pwr_tStatus status,
qcom_sNode node,
pwr_tNodeId  nid 
)

Get the next qcom node. If nid is pwr_cNNodeId the first node is returned.

Example

for (nid = qcom_cNNid; qcom_NextNode(&sts, &node, nid); nid = node.nid) {
...
}
pwr_tBoolean qcom_NextNode(pwr_tStatus *sts, qcom_sNode *node, pwr_tNodeId nid)
Get the next qcom node. If nid is pwr_cNNodeId the first node is returned.
Definition: rt_qcom.c:565

Definition at line 565 of file rt_qcom.c.

◆ qcom_Put()

pwr_tBoolean qcom_Put ( pwr_tStatus status,
const qcom_sQid qidp,
qcom_sPut pp 
)

Put a new message.

When sending a message an application can use private data, allocated on the stack, head, or static memory, or allocate data from the Qcom pool.

char data[100];
// prepare data
put.data = data;
qcom_Put(&sts, &q, &put);
pwr_tBoolean qcom_Put(pwr_tStatus *sts, const qcom_sQid *receiver, qcom_sPut *put)
Put a new message.
Definition: rt_qcom.c:747
Put data structure.
Definition: rt_qcom.h:174

Internally Qcom will allocate a buffer from the pool and copy user data to that buffer. Another way is to use a buffer allocated from the pool.

put.data = qcom_Alloc(&sts, sizeof(data));
// prepare data
qcom_Put(&sts, &q, &put);
void * qcom_Alloc(pwr_tStatus *sts, unsigned int size)
Allocate a buffer in the qcom pool.
Definition: rt_qcom.c:85

Qcom checks if the buffer is allocated in the pool or not.

Definition at line 747 of file rt_qcom.c.

◆ qcom_QidCompare()

int qcom_QidCompare ( const qcom_sQid q1,
const qcom_sQid q2 
)

Compare two queue identities;.

return <0 if qid_1 < qid_2
return 0 if qid_1 == qid_2
return >0 if qid_1 < qid_2.

Returns
int

Definition at line 858 of file rt_qcom.c.

References qcom_sQid::nid, and qcom_sQid::qix.

◆ qcom_QidIsEqual()

pwr_tBoolean qcom_QidIsEqual ( const qcom_sQid q1,
const qcom_sQid q2 
)

Test if two queue identities are equal.

return true if qid_1 == qid_2
return false if qid_1 != qid_2.

Returns
pwr_tBoolean

Definition at line 880 of file rt_qcom.c.

References qcom_sQid::nid, and qcom_sQid::qix.

◆ qcom_QidIsNotEqual()

pwr_tBoolean qcom_QidIsNotEqual ( const qcom_sQid q1,
const qcom_sQid q2 
)

Test if two queue identities are different.

return true if qid_1 != qid_2
return false if qid_1 == qid_2.

Returns
pwr_tBoolean

Definition at line 892 of file rt_qcom.c.

References qcom_sQid::nid, and qcom_sQid::qix.

◆ qcom_QidIsNotNull()

pwr_tBoolean qcom_QidIsNotNull ( const qcom_sQid q)

Test if queue identity is not null.

return true if qid_1 != qcom_cNQid
return false if qid_1 == qcom_cNQid.

Returns
pwr_tBoolean

Definition at line 918 of file rt_qcom.c.

References qcom_sQid::nid.

◆ qcom_QidIsNull()

pwr_tBoolean qcom_QidIsNull ( const qcom_sQid q)

Test if queue identity is null.

return true if qid_1 == qcom_cNQid
return false if qid_1 != qcom_cNQid.

Returns
pwr_tBoolean

Definition at line 905 of file rt_qcom.c.

References qcom_sQid::nid.

◆ qcom_QidToString()

char* qcom_QidToString ( char *  s,
qcom_sQid qid,
int  prefix 
)

Converts a queue identifier, 'qid' to a string.

The output string will be in the format:

0.1.2.3:1234

If 's' is non null the resultant string will be catenated to 's', otherwise the resultant string will be returned.

If 'prefix' is not zero, a '_Q' prefix will be included in the resultant string.

Returns
char*

Definition at line 1199 of file rt_qcom.c.

References qcom_sQid::nid, cdh_uOid::o, cdh_uOid::pwr, qcom_sQid::qix, and cdh_mOid::vid_3.

◆ qcom_Request()

void* qcom_Request ( pwr_tStatus status,
const qcom_sQid pqid,
qcom_sPut pp,
const qcom_sQid gqid,
qcom_sGet gp,
int  tmo,
pwr_tBitMask  flags 
)

Put a request and return the reply.

The qcom_Request() call combines qcom_Put() and qcom_Get() in one call, and the application is guaranteed that at the return from qcom_Request() it either has the correct reply on the request or a time out. Internal to the qcom_Request() call, Qcom filters away any stray responses.

The request should be answered with a qcom_Reply().

Definition at line 1022 of file rt_qcom.c.

◆ qcom_Unbind()

pwr_tBoolean qcom_Unbind ( pwr_tStatus status,
const qcom_sQid sqid,
const qcom_sQid tqid 
)

Disconnect a target queue from a bound source queue.

Buffers allready queued in the bound queue from the forwarding queue will not be unqueued.

Definition at line 811 of file rt_qcom.c.

◆ qcom_WaitAnd()

pwr_tBoolean qcom_WaitAnd ( pwr_tStatus status,
const qcom_sQid qid,
const qcom_sQid eid,
int  mask,
int  tmo 
)

Wait for an event or a message.

Wait for an event on the message queue (eid) matching the supplied mask, or an message on the message queue (qid).

For qcom_WaitAnd all the bits in the mask have to match the bits in the event.

Returns
pwr_tBoolean

Definition at line 1276 of file rt_qcom.c.

◆ qcom_WaitOr()

pwr_tBoolean qcom_WaitOr ( pwr_tStatus status,
const qcom_sQid qid,
const qcom_sQid eid,
int  mask,
int  tmo,
int *  event 
)

Wait for an event or a message.

Wait for an event on the message queue (eid) matching the supplied mask, or an message on the message queue (qid).

For qcom_WaitOr at least one of the bits in the mask has to match the bits in the event.

Returns
pwr_tBoolean

Definition at line 1228 of file rt_qcom.c.