Commit 67869a7 1 parent 6037396 commit 67869a7 Copy full SHA for 67869a7
File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
name : Build
2
2
on :
3
3
push :
4
- branches :
5
- - main
6
- - beta
4
+ pull_request :
7
5
concurrency :
8
6
group : build-${{ github.ref }}
9
7
cancel-in-progress : false
60
58
needs : prebuild
61
59
name : Release
62
60
runs-on : ubuntu-latest
61
+ if : github.ref == 'refs/heads/main'
63
62
steps :
64
63
- uses : actions/checkout@v4
65
64
- uses : actions/download-artifact@v4
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ const { BluetoothHciSocket } = require('node-gyp-build')(dir);
5
5
6
6
inherits ( BluetoothHciSocket , events . EventEmitter ) ;
7
7
8
+ const HCI_COMMAND_PKT = 0x01 ;
9
+ const OGF_HOST_CTL = 0x03 ;
10
+ const OCF_RESET = 0x0003 ;
11
+
8
12
class BluetoothHciSocketWrapped extends BluetoothHciSocket {
9
13
start ( ) {
10
14
if ( this . _timer ) {
@@ -22,6 +26,14 @@ class BluetoothHciSocketWrapped extends BluetoothHciSocket {
22
26
clearInterval ( this . _timer ) ;
23
27
return super . stop ( ) ;
24
28
}
29
+
30
+ reset ( ) {
31
+ const cmd = Buffer . alloc ( 4 ) ;
32
+ cmd . writeUInt8 ( HCI_COMMAND_PKT , 0 ) ;
33
+ cmd . writeUInt16LE ( OCF_RESET | OGF_HOST_CTL << 10 , 1 ) ;
34
+ cmd . writeUInt8 ( 0x00 , 3 ) ;
35
+ this . write ( cmd ) ;
36
+ }
25
37
}
26
38
27
39
// extend prototype
Original file line number Diff line number Diff line change 61
61
},
62
62
"scripts" : {
63
63
"install" : " node-gyp-build" ,
64
- "postinstall" : " patch-package" ,
65
64
"lint" : " eslint \" **/*.js\" " ,
66
65
"lint-fix" : " eslint \" **/*.js\" --fix" ,
67
66
"prebuildify" : " prebuildify --napi --target 17.0.0 --force --strip --verbose" ,
68
- "prebuildify-cross" : " prebuildify-cross --napi --target 17.0.0 --force --strip --verbose" ,
67
+ "prebuildify-cross" : " patch-package && prebuildify-cross --napi --target 17.0.0 --force --strip --verbose" ,
69
68
"semantic-release" : " semantic-release" ,
70
69
"pretest" : " npm run rebuild" ,
71
70
"rebuild" : " node-gyp rebuild" ,
You can’t perform that action at this time.
0 commit comments