Blog

ANS-BT101M BLE Bluetooth Modülü MAC Adres Türü Kılavuzu

BLE Bluetooth MAC Adres Türleri

Introduction

In BLE (Bluetooth Düşük Enerji) development, the Bluetooth MAC address type is a crucial concept that is easily overlooked by developers but directly affects the success or failure of device connections. Many engineers using the Ansiot Technology ANS-BT101M Bluetooth modülü are often confused by the “address type” parameter appearing in the scan results and connection commands when debugging AT commands—what does it represent? How should it be correctly selected and configured?

This article will take the practical application of the ANS-BT101M Bluetooth module as a starting point to systematically explain the definition, classification, determination criteria, and configuration methods of Bluetooth MAC address types, helping developers quickly master this core knowledge point and improve BLE development efficiency. Whether you are a novice engineer just starting out with Bluetooth Low Energy or an experienced developer who wants to delve deeper into the protocol details, this article can provide you with clear ideas and practical operational guidance.

BEN. Address Type Parameter in the ANS-BT101M Bluetooth Module

The ANS-BT101M is a high-performance BLE Bluetooth module launched by Ansiot Technology, supporting master/slave modes and widely used in IoT devices, akıllı evler, health monitoring, and other scenarios. When the ANS-BT101M is running as the host, two core AT commands involve MAC address type parameters:

1.1 Scan Command: AT+SCAN

Command Format: AT+SCAN=param1{,param2{,param3}}

The scan response contains the following parameters:

First Response Format: param1 sequence number, param2 MAC address type, param3 MAC address, param4 RSSI signal value, param5 device name length, param6 device name.

Second Response Format: param1 MAC address type, param2 MAC address, param3 RSSI signal value, param4 broadcast type, param5 broadcast length, param6 broadcast content.

As can be seen, regardless of the response format, the MAC address type is an indispensable field. Developers must correctly extract this parameter when parsing the scan results; otherwise, subsequent connections will fail.

1.2 Connection Command: AT+CONN

Command Format: AT+CONN=param1,param2

param1 is the MAC address of the target device, and param2 is the MAC address type of the target device. When performing a connection operation, developers need to pass the MAC address and its corresponding address type obtained during the scanning phase into the connection command. Mismatch between address type and MAC address is one of the common reasons for BLE connection failure. In actual development, it is recommended that developers establish a unified device information structure in the program, binding and storing the MAC address and address type to avoid parameter transmission errors from the source.

II. What is a Bluetooth MAC Address Type?

The “0” veya “1” in the Bluetooth MAC address type field is not arbitrarily set, but is automatically determined by the Bluetooth protocol stack based on the actual address type used by the device, reflected in the link layer header of the BLE data packet. Understanding this mechanism is fundamental to mastering the principles of BLE communication.

2.1 Definition of Address Type Field

In the link layer header of a BLE air packet, TxAdd and RxAdd each occupy 1 biraz, with the following meanings: a value of 0 indicates that the following 6 bytes of device address is a public address; a value of 1 indicates that the following 6 bytes of device address is a random address. This flag is automatically filled or parsed by the protocol stack each time a packet is sent and received. Developers do not need to manually intervene, but the device’s address type needs to be configured correctly.

2.2 Basis for Address Type Determination

The MAC address type is determined by two key factors:

Factor 1: Device Configuration. Devices can be configured to use public or random addresses. Public addresses are globally unique fixed addresses, consisting of a 24-bit Organization Unique Identifier (OUI) assigned by IEEE and a 24-bit vendor-defined portion. Random addresses are generated by the device itself, including two main forms: static random addresses and private addresses.

Factor 2: Communication Scenario Requirements When sending data packets, the protocol stack automatically fills in the TxAdd field based on the current device configuration; when receiving data packets, it sets the RxAdd field based on the address type information sent by the peer. This process is entirely handled by the underlying protocol stack, ensuring the accuracy of data transmission.

2.3 Comparison of Public Addresses and Random Addresses

Public Address (Value 0): Globally unique, fixed, and widely compatible, but lacks privacy protection and is subject to tracking risks. Suitable for devices requiring a fixed identity.

Random Address (Value 1): Generated by the device itself, can be changed periodically, has privacy protection capabilities, eşin karşılık gelen adres türünü desteklemesini gerektirir, ve gizliliğin korunmasına öncelik veren uygulamalar için uygundur.

Dört BLE MAC adresi türüne infografik genel bakış

III. Rastgele Adreslerin Sınıflandırılması ve Gizlilik İşlevleri

Rastgele adresler, BLE protokolünde cihaz gizliliği korumasının uygulanmasına yönelik temel mekanizmadır. Davranış özelliklerine göre, aşağıdaki üç kategoriye ayrılabilirler:

3.1 Statik Rastgele Adresler

Statik rastgele adresler, cihaz açıldıktan sonra oluşturulur ve yeniden başlatılmadığı veya fabrika ayarlarına geri dönmediği sürece değişmeden kalır.. Gerçek genel adresi açığa çıkarmadan yerel bir alanda sabit bir kimliğin korunmasını gerektiren senaryolar için uygundurlar.

3.2 Çözülebilir Özel Adres

Resolvable private addresses are based on a periodically changing Identity Resolution Key (IRK). Only devices bound to and possessing the corresponding IRK can resolve the true identity. This is the most commonly used address type for BLE privacy features, effectively preventing third parties from continuously tracking devices via MAC addresses. Örneğin, when the ANS-BT101M module is deployed in a wearable device, using a resolvable private address can prevent malicious tracking of the user’s location.

3.3 Unresolvable Private Address

Unresolvable private addresses are completely randomly generated and cannot be associated with a device identity. They are suitable for purely anonymous broadcast scenarios, such as applications that only send signals and do not need to be identified by any specific device.

IV. Practical Configuration Recommendations

4.1 How to Choose an Address Type?

Choose the appropriate address type based on the application scenario: Use public addresses when a fixed identity is required (örneğin, fixed device pairing); use resolvable private addresses when privacy protection is paramount (örneğin, wearable devices, mobil cihazlar); use unresolvable private addresses for anonymous broadcast applications (örneğin, beacons).

Decision flowchart for address type selection

4.2 Configuration Method on ANS-BT101M

Developers can set the “Own Address Type” parameter of the ANS-BT101M Bluetooth modülü using AT commands or SDK API to determine the address type used in subsequent communication. It is recommended to define the address type strategy early in product development to avoid connection anomalies during later debugging. Üstelik, in batch deployment scenarios, sonraki bakım ve ürün yazılımı yükseltmelerinin daha kolay yapılabilmesi için adres türü yapılandırmasının tüm cihazlarda standartlaştırılması önerilir. Ansiot Teknolojisi, müşterilerin adres türüyle ilgili yapılandırmaları hızlı bir şekilde tamamlamalarına yardımcı olmak için kapsamlı teknik belgeler ve mühendislik desteği sağlar..

ANS-BT101M AT komut yapılandırma şeması

V. Sıkça Sorulan Sorular (SSS)

1. Çeyrek: BLE bağlantı hatası MAC adresi türüyle mi ilgili??

Evet. Bağlantı komutunda iletilen adres türü, hedef aygıt tarafından gerçekte kullanılan adres türüyle tutarsız olduğunda bağlantı başarısız olur. Bağlanmayı denemeden önce bir tarama komutu aracılığıyla hedef cihazın doğru adres tipinin elde edilmesi önerilir..

2. Çeyrek: ANS-BT101M ile ANS-BT301M arasında adres tipi kullanımında fark var mı?

Both modules comply with the BLE protocol standard and have the same address type mechanism. The ANS-BT101M focuses on low-power master/slave applications, while the ANS-BT301M offers richer interface options, allowing developers to choose based on project needs.

3. Çeyrek: Will using a random address affect device pairing?

When using a resolvable private address, already bound devices can identify the peer via the IRK, without affecting the pairing process. Fakat, unbound devices cannot resolve the address, so it’s necessary to switch to a resolvable address type during initial pairing.

Çözüm

The 0/1 value of the Bluetooth MAC address type field is a flag automatically generated by the BLE protocol stack based on device configuration, reflecting whether a public address or a random address is currently being used. Adres türünün doğru şekilde yapılandırılması, cihaz gizliliğini etkili bir şekilde korurken işlevsel gereksinimleri de karşılayabilir. Ansiot Technology ANS-BT101M ve ANS-BT301M gibi BLE Bluetooth modüllerini kullanan geliştiriciler için, Adres türü mekanizmasının derinlemesine anlaşılması, istikrarlı cihaz bağlantıları ve güvenli veri iletimi sağlamak için çok önemlidir.

Daha fazla teknik bilgi ve geliştirme desteği için ANS-BT101M Ve ANS-BT301M Bluetooth modülleri, ayrıntılı ürün özelliklerini ve uygulama notlarını almak için lütfen Ansiot Technology web sitesini ziyaret edin.