This function gets the device's Bluetooth address as a 12-digit hexadecimal string.

Syntax

int BltGetLocalAddress(
  char *BD_ADDR 
);

Parameters

BD_ADDR
[out] Specify the pointer to store the acquired Bluetooth address.

Return value

Returns OK if the function succeeds, otherwise it returns other value.

Remarks

Gets the Bluetooth address of the device.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"

void main(void)
{ 
    static char local_address[12];
    int key;
    int ret;

    ResetKey();
    printf("\fPress TRIGGER_KEY key");
    for(;;)
        {
        if ((key =getchar()) != EOF)
        {
            ResetKey();
            switch (key)
            {
            case TRIGGER_KEY:
                Sound(TSTANDARD,VHIGH,SHIGH,0);
                ret = BltGetLocalAddress (local_address);
                if (ret == OK)
                    printf("\nAddress = %s", local_address);
                break;

            default:
                Sound(TCLICK,VHIGH,SLOW,0);
                break;
            }
        }
        Idle();
    }
}

Last updated: 2020/10/07