Skip to content

Commit 990ef4e

Browse files
committed
Clarifying Packet Table usage in README.md
1 parent 479af6f commit 990ef4e

File tree

1 file changed

+55
-29
lines changed

1 file changed

+55
-29
lines changed

README.md

+55-29
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<a href="https://www.buymeacoffee.com/st1vms"><img src="https://img.buymeacoffee.com/button-api/?text=1 Pizza Margherita&emoji=🍕&slug=st1vms&button_colour=0fa913&font_colour=ffffff&font_family=Bree&outline_colour=ffffff&coffee_colour=FFDD00" /></a>
22
# dynamic-bits
3+
34
## Table of content
45

56
- [Overview](#overview)
6-
- [Installation](#installation)
7-
- [Manual (Linux)](#manual-linux-installation)
8-
- [Requirements (Linux)](#requirements-linux)
9-
- [Manual (Android)](#manual-android-installation)
10-
- [Requirements (Android)](#requirements-android)
7+
- [Linux Installation](#linux-installation)
8+
- [Building on Linux (Cmake)](#building-on-linux-cmake)
9+
- [Android Installation](#manual-android-installation)
1110
- [Uninstalling](#uninstalling)
1211
- [Usage](#usage)
1312
- [Notes](#notes)
1413

15-
-------------------------------------
1614

17-
## Overview
15+
# Overview
1816

1917
This is a serialization library that supports **variable length integers/doubles**, **UTF8 strings** and serialization of **boolean bits**.
2018
This library is designed to be **strong**, **lightweight** and **fast**, using (one-malloc) allocation strategy and minimizing the amount of resources during serialization/deserialization.
@@ -25,21 +23,34 @@ Each "packet" is defined in a packet table, a fixed number of fields is assigned
2523

2624
Programmers must register their packets in the table before any de/serialization activity, this way thread safety can be achieved.
2725

28-
-------------------------------------
2926

30-
## Installation
27+
# Linux-Installation
3128

32-
For now only Linux manual installation option is available, along with Android binding...
29+
## Requirements
3330

34-
## Manual-Linux-Installation
31+
- [cmake](https://cmake.org/install/) is required in order to build this library.
32+
- Download this repository, either by zip or git using:
33+
```
34+
git clone https://github.com/st1vms/dynamic-bits
35+
```
3536
36-
### Requirements-Linux
37+
## Before building
38+
_____________________________________
3739
38-
- [cmake](https://cmake.org/install/) is required in order to build this library.
3940
40-
After downloading the git repository, move into the downloaded directory, make a build folder and generate build files using cmake.
41+
Ensure to set optimal values for `PACKET_TABLE_SIZE` and `MAX_PACKET_FIELDS` macros. They are located in the first lines of [include/dpacket.h](include/dpacket.h)
42+
43+
***PACKET_TABLE_SIZE** -> Max number of packets that can be registered.*
44+
45+
***MAX_PACKET_FIELDS** -> Max number of fields a packet can hold.*
46+
47+
It is drastically important to tweak these two values in order to optimize space required for building the static packet table.
48+
49+
## Building-On-Linux-CMake
50+
__________________________________
51+
52+
After configuration is done, open a terminal inside the repository directory, make a build folder and generate build files using cmake.
4153
```
42-
git clone https://github.com/st1vms/dynamic-bits
4354
cd ./dynamic-bits
4455
mkdir build
4556
cd build
@@ -48,28 +59,33 @@ cmake .. && cmake --build .
4859
4960
Inside the build folder you will find the generated shared library.
5061
51-
To install the library run these two commands inside build folder...
62+
To install the library on Linux run these two commands inside build folder...
5263
5364
```
5465
sudo make install
5566
sudo ldconfig /usr/local/lib
5667
```
5768
58-
-------------------------------------
59-
60-
## Uninstalling
61-
62-
Run these two commands inside project folder...
63-
```
64-
chmod u+x uninstall.sh
65-
sudo ./uninstall.sh
66-
```
6769
68-
-------------------------------------
70+
# Manual-Android-Installation
6971
70-
## Manual-Android-Installation
7172
- Install [Android Studio](https://cmake.org/install/) if not already installed.
7273
- Open the JDBits bind project inside Android Studio
74+
75+
## Before Building ( Android )
76+
_____________________________________
77+
Ensure to set optimal values for `PACKET_TABLE_SIZE` and `MAX_PACKET_FIELDS` macros. They are located in the first lines of [jdbits/src/main/cpp/include/dpacket.h](binds/Android/JDBits/jdbits/src/main/cpp/include/dpacket.h)
78+
79+
***PACKET_TABLE_SIZE** -> Max number of packets that can be registered.*
80+
81+
***MAX_PACKET_FIELDS** -> Max number of fields a packet can hold.*
82+
83+
It is drastically important to tweak these two values in order to optimize space required for building the static packet table.
84+
85+
86+
## Building AAR library in Android Studio
87+
_____________________________________
88+
7389
- After syncing gradle files, open a terminal and execute this command:
7490
```
7591
JAVA_HOME=$HOME/android-studio/jbr ./gradlew jdbits:assemble
@@ -79,19 +95,29 @@ You will find the generated **jdbits-<build_version>.aar** file inside the `buil
7995
8096
Copy the AAR file into your Android project **`libs`** folder, and import is as an **`implementation`** dependency, using the Android Studio dependency manager in your Project Settings.
8197
82-
-------------------------------------
8398
8499
## Usage
100+
_____________________________________
85101
86102
Please refer to the examples provided in the [examples](examples/) folder, for the specific language/platform you're using...
87103
88104
- [C-Example](examples/c-example/)
89105
- [Android-Java-Example](examples/android-example/app/src/main/java/com/example/dbitsandroidexample/MainActivity.java)
90106
91-
-------------------------------------
92107
93108
## Notes
109+
_____________________________________
94110
95111
This library doesn't still support complex structures, such as arrays, unions, dictonaries, etc...
96112
97113
I'm planning to add them very soon along with bindings for Python and Java.
114+
115+
116+
## Uninstalling
117+
_____________________________________
118+
119+
Run these two commands inside project folder...
120+
```
121+
chmod u+x uninstall.sh
122+
sudo ./uninstall.sh
123+
```

0 commit comments

Comments
 (0)