要幫你檢查 Option 43 嘅 Hex String,首先要理解佢嘅結構。Option 43 係 Vendor Specific Information,通常用嚟傳送例如 Wi-Fi Controller 或 AP Discovery 嘅資訊。Hex String 由幾個部分組成:
Header (Option Code + Length Byte):Option 43 嘅代碼係 2B (十六進制),之後一個 Byte 係總長度。呢個長度必須正確反映後面所有 Vendor Type + Value 嘅總長度。
Vendor Type:每個子選項有一個 Type Byte,例如 01、02 等,代表唔同嘅 Vendor 定義。
Length Byte (per Vendor Type):緊接住 Vendor Type 嘅係一個 Byte,表示該 Value 嘅長度。
Value:實際嘅資料,例如 IP 地址、字串等。
常見錯誤係:總長度 Byte 計算錯誤、Vendor Type 長度同 Value 長度唔一致、或者 Hex String 冇正確分隔。舉例,如果你要傳一個 Controller IP 192.168.1.10,Vendor Type 可能係 01,長度係 04,Value 係 C0 A8 01 0A。咁整體 Hex String 應該係:2B 06 01 04 C0 A8 01 0A。其中 06 係總長度 (Vendor Type + Length + Value = 1 + 1 + 4)。
如果你提供嘅 Hex String Header 長度同實際 Vendor Type + Value 嘅 Byte 數唔一致,就會出現錯誤。另一個常見問題係 Vendor Type 長度 Byte寫錯,例如寫咗 05 但實際只提供咗 4 個 Byte。
我建議你將 Hex String 貼出嚟,我可以逐個 Byte 幫你拆解,檢查 Header 長度、Vendor Type 同 Value 是否對齊。咁樣可以精確指出邊個位置砌錯。
Domic Vo.