Test parsing boolean.
[apps/agl-service-can-low-level.git] / README.mkd
1 CAN Message Utilities for C
2 ============
3
4 ## Bitfield Manipulation
5
6 ## CAN Signal Encoding
7
8 ## CAN Signal Decoding
9
10 The library supports parsing floating point CAN signals as well as booleans.
11
12     uint64_t payload = 0xeb00000000000000;
13     float result = bitfield_parse_float(payload,
14             2, // starting bit
15             4, // width of the signal's field
16             1001.0, // transformation factor for the signal value
17             -30000.0); // transformation offset for the signal value
18     // result == -19990.0
19
20     bool result = bitfield_parse_bool(payload,
21             0, // starting bit
22             1, // width of the signal's field
23             1.0, // transformation factor for the signal value
24             0); // transformation offset for the signal value
25     // result == true
26
27 ## Testing
28
29 The library includes a test suite that uses the `check` C unit test library.
30
31     $ make test
32
33 ## Authors
34
35 Chris Peplin cpeplin@ford.com
36
37 ## License
38
39 Copyright (c) 2013 Ford Motor Company
40
41 Licensed under the BSD license.