Go to file
Jacob Keeler 48d38d5b7a
Merge pull request #57 from smartdevicelink/release/1.2.5
Release 1.2.5
2021-06-08 14:54:25 -04:00
BsonJavaPort Update library versions for each platform to 1.2.5 (#56) 2021-06-04 17:26:56 -04:00
examples Initial Commit 2017-07-27 11:36:17 -04:00
lua Release 1.2.4 (#53) 2020-12-09 17:20:00 -05:00
m4 Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
src Fix for potential memory leak in the bson_array.c file (#55) 2021-06-04 17:20:22 -04:00
test Release 1.2.4 (#53) 2020-12-09 17:20:00 -05:00
.gitignore Update version to 1.2.2 2020-09-18 12:03:50 -04:00
BiSON.podspec Update library versions for each platform to 1.2.5 (#56) 2021-06-04 17:26:56 -04:00
LICENSE Update LICENSE (#37) 2020-09-22 15:55:24 -04:00
Makefile.am Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
Makefile.in Release 1.2.4 (#53) 2020-12-09 17:20:00 -05:00
Package.swift Add Swift Package Manager Support (#49) 2020-10-19 17:42:21 -04:00
README.md Update library versions for each platform to 1.2.5 (#56) 2021-06-04 17:26:56 -04:00
aclocal.m4 Release 1.2.4 (#53) 2020-12-09 17:20:00 -05:00
compile Fix build system 2017-07-27 16:04:11 -04:00
config.guess Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
config.h Release 1.2.4 (#53) 2020-12-09 17:20:00 -05:00
config.h.in Fix issues with previous commit 2020-03-03 10:52:40 -05:00
config.sub Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
configure Update library versions for each platform to 1.2.5 (#56) 2021-06-04 17:26:56 -04:00
configure.ac Update library versions for each platform to 1.2.5 (#56) 2021-06-04 17:26:56 -04:00
depcomp Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
install-sh Fix build system 2017-07-27 16:04:11 -04:00
libbson.pc.in Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
ltmain.sh Add pkgconfig file to install step 2019-05-07 16:44:10 -04:00
missing Fix build system 2017-07-27 16:04:11 -04:00
test-driver Add missing file 2019-01-08 19:01:35 +09:00
third_party.md add emhashmap 2018-10-29 13:31:01 -04:00

README.md

README

Library for converting to and from BSON

Build library

./configure
make

Install library

sudo make install

Build Lua wrapper

Install Dependencies

sudo apt-get install lua5.2 liblua5.2 liblua5.2-dev

Build Library

./configure --with-lua-wrapper=yes
make

Using the Lua Library

bson = require("bson4lua");

bsonBytes = bson.to_bytes({
	doubleValue = {
		type = 0x01, --Double type
		value = 3.141592653589793
	},
	intValue = {
		type = 0x10, --Int32 Type
		value = 360
	},
	stringValue = {
		type = 0x02, --String type
		value = "A string of characters"
	}
});

print(bsonBytes:byte(1, string.len(bsonBytes)));

bsonTable = bson.to_table(string.char(0x05, 0x00, 0x00, 0x00, 0x00)); --Empty BSON document

print("Table: ");
for k, v in pairs(bsonTable) do
    print(k, v);
end

Apple Platforms

There is a CocoaPod for iOS, MacOS, tvOS, and watchOS. Add to your podfile:

pod 'BiSON'

Android Platforms

There is a jCenter artifact for Android. Add the following to your build.gradle:

dependencies {
    api 'com.smartdevicelink:bson_java_port:1.2.5'
}

Build and run sample program

cd examples
gcc -o sample sample.c -lbson
./sample

Build and run unit tests

Running unit tests requires check framework installed with pkg-config file (.pc). On Ubuntu, please install it by running:

sudo apt-get install check

Once the framework is installed, invoke configure with --with-tests option, build the library then run make check:

./configure --with-tests
make
make check