https://github.com/sdtelectronics/gl9306drv
User-space driver of GL9306 light-stream sensor for Linux
https://github.com/sdtelectronics/gl9306drv
Last synced: over 1 year ago
JSON representation
User-space driver of GL9306 light-stream sensor for Linux
- Host: GitHub
- URL: https://github.com/sdtelectronics/gl9306drv
- Owner: SdtElectronics
- Created: 2021-04-29T01:51:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T01:53:41.000Z (about 5 years ago)
- Last Synced: 2025-04-12T21:51:55.913Z (over 1 year ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GL9306Drv
User-space driver of GL9306 light-stream sensor for Linux.
## Usage
Initialize an instance with the path to the serial connected to the sensor, e.g. `/dev/ttyS7`
```
lightSS sss("/dev/ttyS7");
```
Retrieve a frame excluding the head i.e. start from `Delta_XL`
```
const unsigned char* begin = sss.getFrame();
```
Print a frame excluding the head and tail i.e. from `Delta_XL` to `SQUAL`
```
for(size_t d = 0; d != 7; ++d){
printf("%02X", begin[d]);
}
printf("\n");
```
Retrieve the SQUAL field in a frame
```
unsigned int SQUAL = sss.getSQUAL();
```