1 | import PandaDevice from './panda-device';
|
2 | import PandaAPI from './panda';
|
3 |
|
4 | export const SAFETY_NOOUTPUT = 0;
|
5 | export const SAFETY_HONDA = 1;
|
6 | export const SAFETY_TOYOTA = 2;
|
7 | export const SAFETY_HONDA_BOSCH = 4;
|
8 | export const SAFETY_TOYOTA_NOLIMITS = 0x1336;
|
9 | export const SAFETY_ALLOUTPUT = 0x1337;
|
10 | export const SAFETY_ELM327 = 0xE327;
|
11 |
|
12 | export default function Panda (options) {
|
13 | options = options || {};
|
14 | options.selectDevice = options.selectDevice || selectFirstDevice;
|
15 |
|
16 | var device = new PandaDevice(options);
|
17 | options.device = device;
|
18 | return new PandaAPI(options);
|
19 | }
|
20 |
|
21 | function selectFirstDevice (devices) {
|
22 | return devices[0];
|
23 | }
|