You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Cross net multicast: append 4 bytes:[src_net, src_mac, mh, ml]
Notes:
mh/ml: multicast_id, ml is mapped to mac layer multicast address (h: high byte, l: low byte);
Could simply use MULTI_NET = 0 and MULTICAST = 0 for local net multicast and broadcast.
Implementations of MULTI_NET and MULTICAST are optional.
PORT_SIZE:
Bit1
SRC_PORT
0
1-byte
1
2-byte
Bit0
DST_PORT
0
1-byte
1
2-byte
Notes:
Append bytes forsrc_port beforedst_port.
Implementation of 2-byte port is optional.
Port Allocation Recommendation
Ports 0 to 15 are recommended for general-purpose use. Specifically, port 1 is designated for device information queries. While the port assignments mentioned in this section are optional, it is recommended to implement the basic function of port 1 (read_device_info).
Port numbers ≥ 64 are typically used as ephemeral ports.
Port 1
Provide device info.
Types: - mac_start and mac_end: uint8_t - max_time: uint16_t (unit: ms) - "string": variable-length string, including empty string (excluding the terminating null byte '\0')Read device_info string: Write None Return ["device_info"]Search devices by filters (for resolving mac conflicts): Write [0x10, max_time, mac_start, mac_end, "string"] Return ["device_info"] after a random time in the range [0, max_time] only if "device_info" contains "string" (always true for an empty string) and the current mac address is in the range [mac_start, mac_end] (inclusive) Not return otherwise and reject any subsequent modify mac (or save config) commands
Example ofdevice_info: M: model; S: serial id; HW: hardware version; SW: software version ... Field order is not important; it is recommended to include the model field at least.
CDNET Address String Formats
localhost local link unique local multicast 10:00:00level0: 00:NN:MMlevel1: 80:NN:MM a0:NN:MM f0:MH:ML
For different commands,SRC_PORT can increment sequentially within a defined range. This allows the receiver to avoid re-executing commands during retransmissions and ensures correct matching between requests and responses.
For large data transfers, a high bit inSRC_PORT can be used as anot_reply flag. When set, the receiver does not send a reply. The lower bits ofSRC_PORT increment to indicate the sequence.
We can begin by sending two groups of packets, each requiring a reply only for the last packet. Upon receiving a reply, the next group can be sent. Each group contains multiple packets.
About
CDNET Protocol and CDBUS / CDNET C Library (The library is MCU-oriented.)