- removed type DstAddress and replaced by type PhyComAddress

This commit is contained in:
Michael Zillgith 2015-11-16 12:25:33 +01:00
parent 348273a1c8
commit 603f343d5d
6 changed files with 20 additions and 26 deletions

View file

@ -12,16 +12,16 @@
#include "hal_thread.h"
static void
printDstAddr(DstAddress dstAddress)
printDstAddr(PhyComAddress dstAddress)
{
printf(" addr: ");
int 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(" vid: %u\n", dstAddress.vid);
printf("\n prio: %u\n", dstAddress.vlanPriority);
printf(" vid: %u\n", dstAddress.vlanId);
printf(" appID: %u\n", dstAddress.appId);
}
@ -98,7 +98,7 @@ int main(int argc, char** argv) {
printf("noASDU: %i\n", ClientSVControlBlock_getNoASDU(svcb));
DstAddress dstAddress = ClientSVControlBlock_getDstAddress(svcb);
PhyComAddress dstAddress = ClientSVControlBlock_getDstAddress(svcb);
printDstAddr(dstAddress);

View file

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

View file

@ -331,13 +331,6 @@ IedConnection_getMmsConnection(IedConnection self);
/** an opaque handle to the instance data of a ClientSVControlBlock object */
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
*
@ -415,7 +408,7 @@ ClientSVControlBlock_getSmpRate(ClientSVControlBlock self);
*
* \param self the ClientSVControlBlock instance to operate on
*/
DstAddress
PhyComAddress
ClientSVControlBlock_getDstAddress(ClientSVControlBlock self);
/**

View file

@ -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)
*

View file

@ -270,13 +270,6 @@ struct sSettingGroupControlBlock {
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 {
LogicalNode* parent;
char* name;

View file

@ -39,7 +39,7 @@ extern "C" {
* 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
* 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
* 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