Thursday, December 28, 2017

Eddystone URL Encoding : A Beginner's Guide

For beginners who need to know how to convert url into UINT8_T, This can be a very helpful information:

To begin with, beginners need to know exactly what the URL frame contains and here is the details:

The first 9 bytes of the frame are just prefix. To check the content of the prefix value, see the picture below:

The 10th and 11th byte is constant having the value "AAFE". And starting on the 12th byte is the actual eddystone frame which is broken down into the following:

Frame Specification

Byte offsetFieldDescription
0Frame TypeValue = 0x10
1TX PowerCalibrated Tx power at 0 m
2URL SchemeEncoded Scheme Prefix
3+Encoded URLLength 1-17

The URL prefix have constant designated values:

URL Scheme Prefix

The URL Scheme Prefix byte defines the identifier scheme, an optional prefix and how the remainder of the URL is encoded.

The URL Expansion also have constant values:
14..320x0e..0x20Reserved for Future Use
127..2550x7F..0xFFReserved for Future Use

And the remaining strings in url are converted to hex ascii codes. The URL is 17 bytes including the expansion value.

Here is the raw data from nRF Connect App:

And here is the actual raw data:

To Interpret the data
Byte offsetFieldValue
0Frame Type0x10 
1TX Power0x04 
2URL Scheme0x00 = "http://www."
3+Encoded URL0x06D696E65777465636807
The last 2 digits "07" is the URL extension for ".com"
0x06D696E657774656368 when converted to string is "minewtech". I used the foloowing website for the conversion:

Combining the decoded data that we will get ""

No comments:

Post a Comment