- removed type DstAddress and replaced by type PhyComAddress

pull/6/head
Michael Zillgith 10 years ago
parent 348273a1c8
commit 603f343d5d

@ -12,16 +12,16 @@
#include "hal_thread.h" #include "hal_thread.h"
static void static void
printDstAddr(DstAddress dstAddress) printDstAddr(PhyComAddress dstAddress)
{ {
printf(" addr: "); printf(" addr: ");
int i; int i;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
printf("%02x", dstAddress.addr[i]); printf("%02x", dstAddress.dstAddress[i]);
printf("\n prio: %u\n", dstAddress.priority); printf("\n prio: %u\n", dstAddress.vlanPriority);
printf(" vid: %u\n", dstAddress.vid); printf(" vid: %u\n", dstAddress.vlanId);
printf(" appID: %u\n", dstAddress.appId); printf(" appID: %u\n", dstAddress.appId);
} }
@ -98,7 +98,7 @@ int main(int argc, char** argv) {
printf("noASDU: %i\n", ClientSVControlBlock_getNoASDU(svcb)); printf("noASDU: %i\n", ClientSVControlBlock_getNoASDU(svcb));
DstAddress dstAddress = ClientSVControlBlock_getDstAddress(svcb); PhyComAddress dstAddress = ClientSVControlBlock_getDstAddress(svcb);
printDstAddr(dstAddress); printDstAddr(dstAddress);

@ -271,7 +271,7 @@ ClientSVControlBlock_getNoASDU(ClientSVControlBlock self)
return readUIntVariable(self, "noASDU"); return readUIntVariable(self, "noASDU");
} }
DstAddress PhyComAddress
ClientSVControlBlock_getDstAddress(ClientSVControlBlock self) ClientSVControlBlock_getDstAddress(ClientSVControlBlock self)
{ {
char refBuf[130]; char refBuf[130];
@ -289,7 +289,7 @@ ClientSVControlBlock_getDstAddress(ClientSVControlBlock self)
else else
dstAddrValue = IedConnection_readObject(self->connection, &(self->lastError), refBuf, IEC61850_FC_US); dstAddrValue = IedConnection_readObject(self->connection, &(self->lastError), refBuf, IEC61850_FC_US);
DstAddress retVal; PhyComAddress retVal;
memset(&retVal, 0, sizeof(retVal)); memset(&retVal, 0, sizeof(retVal));
if (dstAddrValue == NULL) goto exit_error; if (dstAddrValue == NULL) goto exit_error;
@ -318,7 +318,7 @@ ClientSVControlBlock_getDstAddress(ClientSVControlBlock self)
uint8_t* addrBuf = MmsValue_getOctetStringBuffer(addr); uint8_t* addrBuf = MmsValue_getOctetStringBuffer(addr);
memcpy(&(retVal.addr), addrBuf, 6); memcpy(&(retVal.dstAddress), addrBuf, 6);
MmsValue* prio = MmsValue_getElement(dstAddrValue, 1); MmsValue* prio = MmsValue_getElement(dstAddrValue, 1);
@ -327,7 +327,7 @@ ClientSVControlBlock_getDstAddress(ClientSVControlBlock self)
goto exit_cleanup; goto exit_cleanup;
} }
retVal.priority = MmsValue_toUint32(prio); retVal.vlanPriority = MmsValue_toUint32(prio);
MmsValue* vid = MmsValue_getElement(dstAddrValue, 2); MmsValue* vid = MmsValue_getElement(dstAddrValue, 2);
@ -336,7 +336,7 @@ ClientSVControlBlock_getDstAddress(ClientSVControlBlock self)
goto exit_cleanup; goto exit_cleanup;
} }
retVal.vid = MmsValue_toUint32(vid); retVal.vlanId = MmsValue_toUint32(vid);
MmsValue* appID = MmsValue_getElement(dstAddrValue, 3); MmsValue* appID = MmsValue_getElement(dstAddrValue, 3);

@ -331,13 +331,6 @@ IedConnection_getMmsConnection(IedConnection self);
/** an opaque handle to the instance data of a ClientSVControlBlock object */ /** an opaque handle to the instance data of a ClientSVControlBlock object */
typedef struct sClientSVControlBlock* ClientSVControlBlock; typedef struct sClientSVControlBlock* ClientSVControlBlock;
typedef struct {
uint8_t addr[6];
uint8_t priority;
uint16_t vid;
uint16_t appId;
} DstAddress;
/** /**
* \brief Create a new ClientSVControlBlock instance * \brief Create a new ClientSVControlBlock instance
* *
@ -415,7 +408,7 @@ ClientSVControlBlock_getSmpRate(ClientSVControlBlock self);
* *
* \param self the ClientSVControlBlock instance to operate on * \param self the ClientSVControlBlock instance to operate on
*/ */
DstAddress PhyComAddress
ClientSVControlBlock_getDstAddress(ClientSVControlBlock self); ClientSVControlBlock_getDstAddress(ClientSVControlBlock self);
/** /**

@ -36,6 +36,14 @@ extern "C" {
*/ */
/**@{*/ /**@{*/
/** PhyComAddress type contains Ethernet address and VLAN attributes */
typedef struct {
uint8_t vlanPriority;
uint16_t vlanId;
uint16_t appId;
uint8_t dstAddress[6];
} PhyComAddress;
/** /**
* @defgroup TRIGGER_OPTIONS Trigger options (bit values combinable) * @defgroup TRIGGER_OPTIONS Trigger options (bit values combinable)
* *

@ -270,13 +270,6 @@ struct sSettingGroupControlBlock {
SettingGroupControlBlock* sibling; /* next control block in list or NULL if this is the last entry */ SettingGroupControlBlock* sibling; /* next control block in list or NULL if this is the last entry */
}; };
typedef struct {
uint8_t vlanPriority;
uint16_t vlanId;
uint16_t appId;
uint8_t dstAddress[6];
} PhyComAddress;
struct sGSEControlBlock { struct sGSEControlBlock {
LogicalNode* parent; LogicalNode* parent;
char* name; char* name;

@ -39,7 +39,7 @@ extern "C" {
* Ethernet interfaces you have to use several \ref SVReceiver instances. * Ethernet interfaces you have to use several \ref SVReceiver instances.
* An \ref SVSubscriber object is associated to a SV data stream that is identified by its appID * An \ref SVSubscriber object is associated to a SV data stream that is identified by its appID
* and destination Ethernet address. The \reg SVSubscriber object is used to install a callback * and destination Ethernet address. The \reg SVSubscriber object is used to install a callback
* handler that is invoked for each ASDU (application service data unit) received for the * handler \ref SVUpdateListener that is invoked for each ASDU (application service data unit) received for the
* associated stream. An \ref SVClientASDU is an object that represents a single ASDU. Each ASDU contains * associated stream. An \ref SVClientASDU is an object that represents a single ASDU. Each ASDU contains
* some meta information that can be obtained by specific access functions like e.g. * some meta information that can be obtained by specific access functions like e.g.
* \ref SVClientASDU_getSmpCnt to access the "SmpCnt" (sample count) attribute of the ASDU. The actual * \ref SVClientASDU_getSmpCnt to access the "SmpCnt" (sample count) attribute of the ASDU. The actual

Loading…
Cancel
Save