4. Format conventions 格式约定
笔记:
- 把待传输的数据当成C语言的结构体:
- 低字节先行
- 字节中的低位先行
4.1. General
Throughout this standard, unless otherwise stated, data structures exposed in interfaces are represented using the conventions and formats defined in this clause.
NOTE—It is important to note that interfaces are depicted in this standard as bit serial by convention but can be implemented in other forms, e.g., 4- or 8-bit parallel. 8
注——重要的是要注意,按照惯例,本标准中的接口被描述为位串行,但也可以以其他形式实现,例如4位或8位并行。
Within the PHY, data structures are passed to the reference modulator input in bit-serial convention. PHY specific coding may change the bit-order and encode multiple information bits into symbols. Hence the over-the-air interface may express the data structure content in a manner different than the conventions defined here.
在PHY内,数据结构以位串行约定传递给参考调制器输入。PHY特定编码可以改变比特顺序,并将多个信息比特编码为符号。因此,空中接口可以以与这里定义的约定不同的方式表示数据结构内容。
After all applicable expansion, the size of a MAC frame shall be less than the maximum PHY service data unit (PSDU) size supported by the PHY in use.
在所有适用的扩展之后,MAC帧的大小应小于所用PHY支持的最大PHY服务数据单元(PSDU)大小。
传输的时候是低字节的低位在前,然后是高字节;
这个和C语言的struct定义的结构体是一致的,低字节的低位在前
4.2. Fields 字段
Fields are concatenated into larger data structures, e.g., Figure 4-1 represents a data structure with 3 fields of
length 2 octets, 6 bits and 2 bits for a total size of 3 octets.
字段被连接成更大的数据结构,例如,图4-1表示一个3个字段的数据结构:其中长度为2个八位字节、6位和2位,总大小为3个八位位组。
4.3. Numbers 数字
Numbers are represented in decimal (nnn), binary (0bnnn), or hexadecimal (0xnnn) notation with the
number of digits indicated. For example, 0b001 is a 3 digit binary number of value 1 and 0x001 is a 3-digit
hexadecimal number of value 1. Numbers encoded in fields are either signed or unsigned integers unless
explicitly defined otherwise. Other formats (e.g., a field containing a floating point number) are stated in the
field definition where applicable.
数字以十进制(nnn)、二进制(0bnnn)或十六进制(0xnnn)表示法表示,并注明数字位数。例如,0b001是一个3位二进制数,值为1,0x001是一个三位十六进制数,值也为1。除非另有明确定义,否则字段中编码的数字要么是有符号整数,要么是无符号整数。在适用的情况下,字段定义中会说明其他格式(例如,包含浮点数的字段)。
When represented in fields, numbers are expressed with LSB leftmost and MSB rightmost as shown in
Figure 4-2 for an n-bit unsigned integer. (Note that this is the inverse of the number representations 0bnnn
and 0xnnn and of common number representations used in mathematical notations.) For example, the
number 0x47 would be represented in an 8-bit field as 1110 0010.
当在字段中表示时,对于n位无符号整数,数字用最左侧的LSB和最右侧的MSB表示,如图4-2所示。(请注意,这是数字表示0bnnn和0xnnn以及数学符号中常用数字表示的逆。)例如,数字0x47在8位字段中表示为1110 0010。
Numbers of size greater than 1 octet occur with the octet containing the least significant bits first (leftmost) followed by octets containing bits of increasing significance to the right.
大小大于1个八位字节的数字出现在首先包含最低有效位的八位字节(最左侧)之后,然后是包含右侧重要性递增位的八位数。
Unless otherwise stated in the definition of a field, a number in a field shall be formatted as an unsigned integer.
除非字段定义中另有说明,否则字段中的数字应格式化为无符号整数。
4.4. Strings
A string of length k bits is represented as a bit sequence numbered from 0 to k – 1. Bit 0 occurs first and is represented as the leftmost bit of a string field. Bit 1 occurs to the right of bit 0 and so on until bit (k – 1). This is illustrated in Figure 4-3.
长度为k位的字符串表示为从0到k-1编号的位序列。位0首先出现,表示为字符串字段的最左侧位。位1出现在位0的右侧,以此类推,直到位(k-1)如图4-3所示。
A string of length greater than 1 octet is represented by the octet containing the lowest numbered bits first and leftmost, followed by octets containing increasing bit numbers to the right.
长度大于1个八位字节的字符串由首先和最左侧包含最低编号比特的八位字节表示,然后是右侧包含递增比特数的八位位组。
4.5. Transmission order
4.5.1. General
For every address field, the bit transmission order shall be performed from the right most octet (RMO) to the left most octet (LMO) in the field, and inside an octet from the LSB to the MSB.
对于每个地址字段,比特传输顺序应从字段中最右侧的八位字节(RMO)到最左侧的八位比特(LMO)执行,并在一个八位字节内从LSB到MSB执行。
Figure 4-4 shows the MAC Address field containing a 64-bit MAC address. For this example the MAC address value is assumed to be AC-DE-64-23-45-67-89-01.
图4-4显示了包含64位MAC地址的MAC地址字段。对于该示例,假设MAC地址值为AC-DE-64-23-45-67-89-01。
4.5.2. Vendor OUI transmission order
Vendor organizationally unique identifier (OUI) bit transmission order shall be performed from the right most octet (RMO) to the leftmost octet (LMO) in the field, and inside an octet from the LSB to the MSB.
供应商组织唯一标识符(OUI)比特传输顺序应从字段中最右侧的八位字节(RMO)到最左侧的八位位组(LMO)执行,并在从LSB到MSB的八位元组内执行。
Figure 4-6 shows the Vendor OUI field. For this example, the vendor OUI field value is assumed to be AC-DE-64.
图4-6显示了供应商OUI字段。对于这个例子,假设供应商OUI字段值为AC-DE-64。