Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

GeckoNickDeveloper/BluetoothTagChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

BTC (Bluetooth Tag Chain)

BTC is born with the idea of transmit small quantity of data between two devices via Bluetooth. It's also inspired by JSON but tries to be more lightweight.

It's very important to specify that BTC supports mixed lists:
different data types can be included to the list, including more lists.

Specific

This data rappresentation is based on those 3 data types:

  • Numbers
  • Strings
  • Booleans

Syntax

There are few sintax rules, but they are very strict:


Elements
An ELEMENT is a child of Object. It is composed by TAG and VALUE

Each element must start with @
TAGs are strings that can be composed by -
TAG is case sensitive
A TAG ends with > character


Items
An ITEM is a child of List. It is a pure VALUE.

An item must ends with , character if it isn't the last in the list.


Strings
Strings are rappresented with: "my string"
There are some limitations:

Only UTF-8 characters can be used
The only special characters that can be rappresented are:
- \r
- \n
- \t
- \'
- \"
- \\


Numbers
Numbers are rappresented with a series of numbers (for example: 37.49)


Booleans
Booleans are rappresented with true or false


Complex types
Both complex types (List and Object) can be empty.

Element

An Element is a basic pair between a TAG and DATA

@identifier-name > *

Where * can assume the following data types:

  • Basic Datas:
    • Numbers (Decimals and Integers)
    • Strings
    • Booleans
  • Complex Datas:
    • Objects
    • Lists

Object

An object is a structure composed of several Elements.
Object syntax

An Object starts with ( and ends with )
Each item inside an Object IS an Element

(
    @comp-a > 13
    @comp-b > "Ajeje Brazorf"
    @comp-c > true
)

List

Lists are compositions of Data.
List syntax

A List starts with [ and ends with ]
Each item in the List is separated by , character
Each item in the List ISN'T an Element: IS a DATA

[
    420.69,
    "Mixed Type List",
    (
        @comp-a > "Wait. That's illegal."
        @comp-b > "Ah, I see you're a developer of culture as well!"
        @comp-c > true
    ),
    [
        "Wait. That's",
        "Outstanding move",
        "Behind science",
        "*MEME's POWER INTESIFIES*"
    ]
]

About

Data-file format created by me

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published