---
# System prepended metadata

title: Gurux Mbed

---

# Gurux Mbed

<!-- View the book with "<i class="fa fa-book fa-fw"></i> Book Mode". -->



HDLC 初始化及設定
---

- src/server.c - svr_handleRequest2(): 主要function，接收來自uart_tx的char，確認data，生成reply
    - src/dlms.c - dlms_getData2(): 確認data受否已經全部接收完
    - src/dlms.c - dlms_getHdlcFrame(): 解析收到的frame，生成reply
        - 第2個參數表示不同的mode
            - DLMS_COMMAND_DISCONNECT_MODE
            - DLMS_COMMAND_REJECTED
            - ...
            or 直接取client值(猜測)
            - getReceiverReady(&settings->base)
            - getNextSend(&settings->base, 0)
            - getKeepAlive(&settings->base)
            - ...

---
    
待查
---

### main.cpp

- `Meter serial number` 意思？
```cpp=75
//Meter serial number.****
unsigned long SERIAL_NUMBER = 123456;
```

- `HDLC_BUFFER_SIZE`, `PDU_BUFFER_SIZE` 差別
```cpp=78
#define HDLC_BUFFER_SIZE 128
#define PDU_BUFFER_SIZE 256
unsigned char pdu[PDU_BUFFER_SIZE];
unsigned char frame[HDLC_BUFFER_SIZE];


###### tags: `work`gdfvkjdbr fffcjb kiedy tmdu
h jrvdvvunexcwsbgvrrvmfi