Ethernet Entity¶
- group EthernetEntity
EthernetClass: IP configuration. MAC info. BrainD port.
-
void ethernet_setEnabled(unsigned int *id, struct Result *result, const int index, const unsigned char enabled)¶
Sets the Ethernet’s interface to enabled/disabled.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
enabled – 1 = enabled; 0 = disabled
-
void ethernet_getEnabled(unsigned int *id, struct Result *result, const int index)¶
Gets the current enable value of the Ethernet interface.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. 1 = Fully enabled network connectivity; 0 = Ethernet MAC is disabled.
index – The index of the entity in question.
-
void ethernet_getNetworkConfiguration(unsigned int *id, struct Result *result, const int index)¶
Get the method in which IP Address is assigned to this device
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Method used. Current methods
NONE = 0
STATIC = 1
DHCP = 2
index – The index of the entity in question.
-
void ethernet_setNetworkConfiguration(unsigned int *id, struct Result *result, const int index, const unsigned char addressStyle)¶
Get the method in which IP Address is assigned to this device
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
addressStyle – Method to use. See getNetworkConfiguration for addressStyle enumerations.
-
void ethernet_getStaticIPv4Address(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get the expected IPv4 address of this device, when networkConfiguration == STATIC
The functional IPv4 address of The Module will differ if NetworkConfiguration != STATIC.
Returns common entity return values- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. occupied bytes in buffer, Should be 4 post-call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] for returned output
bufferLength – size of buffer. Should be 4.
-
void ethernet_setStaticIPv4Address(unsigned int *id, struct Result *result, const int index, unsigned char const *buffer, unsigned int bufferLength)¶
Set the desired IPv4 address of this device, if NetworkConfiguration == STATIC
Returns common entity return values
setStaticIPv4Address(192, 168, 10, 2) would equate with address “192.168.10.2”- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] with an IP address
bufferLength – size of buffer. Should be 4.
-
void ethernet_getStaticIPv4Netmask(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get the expected IPv4 netmask of this device, when networkConfiguration == STATIC
The functional IPv4 netmask of The Module will differ if NetworkConfiguration != STATIC.
Returns common entity return values- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. occupied bytes in buffer, Should be 4 post-call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] for returned output
bufferLength – size of buffer. Should be 4.
-
void ethernet_setStaticIPv4Netmask(unsigned int *id, struct Result *result, const int index, unsigned char const *buffer, unsigned int bufferLength)¶
Set the desired IPv4 address of this device, if NetworkConfiguration == STATIC
Returns common entity return values
setStaticIPv4Netmask([255, 255, 192, 0], 4) would equate with address “255.255.192.0”, or /18 in CIDR notation.- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] with an IP address
bufferLength – size of buffer. Should be 4.
-
void ethernet_getStaticIPv4Gateway(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Set the desired IPv4 gateway of this device, if NetworkConfiguration == STATIC
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. occupied bytes in buffer, Should be 4 post-call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] for returned output
bufferLength – size of buffer. Should be 4.
-
void ethernet_setStaticIPv4Gateway(unsigned int *id, struct Result *result, const int index, unsigned char const *buffer, unsigned int bufferLength)¶
Set the desired IPv4 gateway of this device, if NetworkConfiguration == STATIC
Returns common entity return values
setStaticIPv4Gateway([192, 168, 1, 1], 4) would equate with address “192.168.1.1”- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] with an IP address
bufferLength – size of buffer. Should be 4.
-
void ethernet_getIPv4Address(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get the effective IP address of this device.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. occupied bytes in buffer, Should be 4 post-call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] for returned output
bufferLength – size of buffer. Should be 4.
-
void ethernet_getIPv4Netmask(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get the effective IP netmask of this device.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. occupied bytes in buffer, Should be 4 post-call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] for returned output
bufferLength – size of buffer. Should be 4.
-
void ethernet_getIPv4Gateway(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get the effective IP gateway of this device.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. occupied bytes in buffer, Should be 4 post-call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[4] for returned output
bufferLength – size of buffer. Should be 4.
-
void ethernet_setStaticIPv4DNSAddress(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, unsigned int bufferLength)¶
Set IPv4 DNS Addresses (plural), if NetworkConfiguration == STATIC.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[N][4]
bufferLength – Total array length in bytes. Must be a multiple of 4.
-
void ethernet_getStaticIPv4DNSAddress(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get IPv4 DNS addresses (plural), when NetworkConfiguration == STATIC.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Length of occupied bytes of buffer, after the call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[N][4]
bufferLength – Maximum length of array, in bytes.
-
void ethernet_getIPv4DNSAddress(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get effective IPv4 DNS addresses, for the current NetworkConfiguration.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Length of occupied bytes of buffer, after the call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[N][4]
bufferLength – Maximum length of array, in bytes.
-
void ethernet_setHostname(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, unsigned int bufferLength)¶
Set hostname that’s requested when this device sends a DHCP request.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[N]
bufferLength – N, for N bytes.
-
void ethernet_getHostname(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get hostname that’s requested when this device sends a DHCP request.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Length of occupied bytes of buffer, after the call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[N]
bufferLength – N, for N bytes.
-
void ethernet_getMACAddress(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, unsigned int bufferLength)¶
Get hostname that’s requested when this device sends a DHCP request.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Length of occupied bytes of buffer, after the call.
index – The index of the entity in question.
buffer – alias to an array of uint8_t[6]
bufferLength – length of buffer that’s writeable, should be > 6.
-
void ethernet_setBraindPort(unsigned int *id, struct Result *result, const int index, const unsigned short port)¶
Set the port of the BrainD HTTP server.
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
index – The index of the entity in question.
port – The port to be used for the BrainD server.
-
void ethernet_getBraindPort(unsigned int *id, struct Result *result, const int index)¶
Get the port (desired) of the BrainD HTTP server.
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. The port of the BrainD server.
index – The index of the entity in question.