pud: remove getNodeId, rename getNodeIdWithLength to getNodeId
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 1 Oct 2013 09:37:50 +0000 (11:37 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 1 Oct 2013 12:44:06 +0000 (14:44 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/configuration.c
lib/pud/src/configuration.h
lib/pud/src/receiver.c

index e73d80a..79929d9 100644 (file)
@@ -73,14 +73,6 @@ static bool nodeIdSet = false;
 static nodeIdBinaryType nodeIdBinary;
 
 /**
- @return
- The node ID
- */
-unsigned char * getNodeId(void) {
-       return getNodeIdWithLength(NULL);
-}
-
-/**
  Get the nodeId and its length
 
  @param length
@@ -90,7 +82,7 @@ unsigned char * getNodeId(void) {
  @return
  The node ID
  */
-unsigned char * getNodeIdWithLength(size_t *length) {
+unsigned char * getNodeId(size_t *length) {
        if (!nodeIdSet) {
                setNodeId("", NULL, (set_plugin_parameter_addon) {.pc = NULL});
        }
@@ -176,7 +168,7 @@ static bool intSetupNodeIdBinaryMAC(void) {
 static bool intSetupNodeIdBinaryLongLong(unsigned long long min,
                unsigned long long max, unsigned int bytes) {
        unsigned long long longValue = 0;
-       if (!readULL(PUD_NODE_ID_NAME, (char *) getNodeId(), &longValue)) {
+       if (!readULL(PUD_NODE_ID_NAME, (char *) getNodeId(NULL), &longValue)) {
                return false;
        }
 
@@ -200,7 +192,7 @@ static bool intSetupNodeIdBinaryLongLong(unsigned long long min,
 static bool intSetupNodeIdBinaryString(void) {
        char report[256];
        size_t nodeidlength;
-       char * nodeid = (char *)getNodeIdWithLength(&nodeidlength);
+       char * nodeid = (char *)getNodeId(&nodeidlength);
 
        if (nmea_parse_sentence_has_invalid_chars(nodeid, nodeidlength, PUD_NODE_ID_NAME, &report[0], sizeof(report))) {
                pudError(false, "%s", &report[0]);
index 402306e..45ae1c8 100644 (file)
@@ -29,8 +29,7 @@ int setNodeIdType(const char *value, void *data,
 /** The name of the nodeId plugin parameter */
 #define PUD_NODE_ID_NAME                                               "nodeId"
 
-unsigned char * getNodeId(void);
-unsigned char * getNodeIdWithLength(size_t *length);
+unsigned char * getNodeId(size_t *length);
 nodeIdBinaryType * getNodeIdBinary(void);
 int setNodeId(const char *value, void *data, set_plugin_parameter_addon addon);
 
index eb29bff..b61e973 100644 (file)
@@ -795,7 +795,7 @@ bool startReceiver(void) {
 
        transmitGpsInformation.txGateway = olsr_cnf->main_addr;
        transmitGpsInformation.positionUpdated = false;
-       transmitGpsInformation.nodeId = getNodeId();
+       transmitGpsInformation.nodeId = getNodeId(NULL);
 
 #ifdef HTTPINFO_PUD
        olsr_cnf->pud_position = &transmitGpsInformation;