Skip to content

Commit eb92813

Browse files
committed
Restricting packet table macro editing only to max fields.
1 parent cdc99ca commit eb92813

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

Diff for: README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ Programmers must register their packets in the table before any de/serialization
3535
```
3636
3737
## Before building
38+
_____________________________________
39+
Ensure to set optimal value for `MAX_PACKET_FIELDS` macro. It is located in the first lines of [include/dpacket.h](include/dpacket.h)
3840
39-
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)
41+
***MAX_PACKET_FIELDS** -> Max number of fields a packet can hold.*
4042
41-
***PACKET_TABLE_SIZE** -> Max number of packets that can be registered.*
43+
It is drastically important to tweak this value in order to optimize space required for building the static packet table,
4244
43-
***MAX_PACKET_FIELDS** -> Max number of fields a packet can hold.*
4445
45-
It is drastically important to tweak these two values in order to optimize space required for building the static packet table.
46+
*PacketTableByteSize = 255 * (MAX_PACKET_FIELDS) bytes*
4647
4748
## Building-On-Linux-CMake
4849
@@ -70,15 +71,15 @@ sudo ldconfig /usr/local/lib
7071
- Open the JDBits bind project inside Android Studio
7172
7273
## Before Building ( Android )
73-
74-
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)
75-
76-
***PACKET_TABLE_SIZE** -> Max number of packets that can be registered.*
74+
_____________________________________
75+
Ensure to set optimal value for `MAX_PACKET_FIELDS` macro. It is located in the first lines of [jdbits/src/main/cpp/include/dpacket.h](binds/Android/JDBits/jdbits/src/main/cpp/include/dpacket.h)
7776
7877
***MAX_PACKET_FIELDS** -> Max number of fields a packet can hold.*
7978
80-
It is drastically important to tweak these two values in order to optimize space required for building the static packet table.
79+
It is drastically important to tweak this value in order to optimize space required for building the static packet table.
80+
8181
82+
*PacketTableByteSize = 255 * (MAX_PACKET_FIELDS) bytes*
8283
8384
## Building AAR library in Android Studio
8485

Diff for: binds/Android/JDBits/jdbits/src/main/cpp/include/dpacket.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#ifndef __DPACKET_H
22

3-
// Max number of packets
4-
#define PACKET_TABLE_SIZE 20
3+
const unsigned int PACKET_TABLE_SIZE = (1<<8)-1;
54

65
// Max number of fields x packet
76
#define MAX_PACKET_FIELDS 20
87

8+
// The result packet table,
9+
// will occupy 255*(MAX_PACKET_FIELDS) bytes
10+
911
#include <dtypes.h>
1012

1113
#ifdef __cplusplus

Diff for: include/dpacket.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#ifndef __DPACKET_H
22

3-
// Max number of packets
4-
#define PACKET_TABLE_SIZE 20
3+
const unsigned int PACKET_TABLE_SIZE = (1<<8)-1;
54

65
// Max number of fields x packet
76
#define MAX_PACKET_FIELDS 20
87

8+
// The result packet table,
9+
// will occupy 255*(MAX_PACKET_FIELDS) bytes
10+
911
#include <dtypes.h>
1012

1113
#ifdef __cplusplus

0 commit comments

Comments
 (0)