Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit f0e922a

Browse files
committed
UserGuideExamples: Remove old blesvccommit function
1 parent 4b5109e commit f0e922a

File tree

6 files changed

+25
-22
lines changed

6 files changed

+25
-22
lines changed

UserGuideExamples/BleCharDescRead.sb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ DIM rc,conHndl,hMyChar
77
//----------------------------------------------------------------------------
88
SUB OnStartup()
99
DIM hSvc,attr$,scRpt$,adRpt$,addr$
10-
rc = BleSvcCommit(1,BleHandleUuid16(0x18FF),hSvc)
11-
// Add one or more characteristics
12-
rc = BleCharNew(0x08,BleHandleUuid16(0x2AFF),BleAttrMetadata(1,1,20,1,rc),0,0)
13-
attr$="\00" //no initial alert
14-
rc = BleCharCommit(hSvc,attr$,hMyChar)
15-
10+
11+
rc = BleServiceNew(1, BleHandleUuid16(0x18FF), hSvc)
12+
//Add one or more characteristics
13+
rc = BleCharNew(0x0a,BleHandleUuid16(0x2AFF),BleAttrMetadata(1,1,20,1,rc),0,0)
14+
1615
//Add a user description
1716
DIM s$ : s$="You can change this"
18-
rc=BleCharDescUserDesc(s$,BleAttrMetadata(1,1,20,1,rc))
19-
17+
rc=BleCharDescUserDesc(s$,BleAttrMetadata(1,1,20,0,rc))
18+
19+
attr$="\00" //no initial alert
20+
rc = BleCharCommit(hSvc,attr$,hMyChar)
21+
//Commit the service
22+
rc = BleServiceCommit(hSvc)
23+
2024
rc=BleScanRptInit(scRpt$)
2125
//Add 1 char handle to scan report
2226
rc=BleAdvRptAddUuid16(scRpt$,hMyChar,-1,-1,-1,-1,-1)
@@ -30,7 +34,6 @@ ENDSUB
3034
// Close connections so that we can run another app without problems
3135
//==============================================================================
3236
SUB CloseConnections()
33-
3437
rc=BleDisconnect(conHndl)
3538
rc=BleAdvertStop()
3639
ENDSUB

UserGuideExamples/BleSecMngrOobKey.sb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ONEVENT EVBLEMSG CALL HandlerBleMsg
3232

3333
IF BleAdvertStart(0,addr$,25,60000,0)==0 THEN
3434
PRINT "\nAdverts Started\n"
35-
PRINT "\nMake a connection to the BL600"
35+
PRINT "\nMake a connection to the BL652"
3636
ELSE
3737
PRINT "\n\nAdvertisement not successful"
3838
ENDIF

UserGuideExamples/EvAuthCccd.sb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ FUNCTION OnStartup()
1313
DIM charMet : charMet = BleAttrMetaDataex(1,1,20,0,metaSuccess)
1414
DIM hSvcUuid : hSvcUuid = BleHandleUuid16(svcUuid)
1515
DIM mdCccd : mdCccd = BleAttrMetadataex(1,1,2,8,rc) //CCCD metadata for char, write auth
16-
16+
1717
//Commit svc with handle 'hSvcUuid'
18-
rc=BleSvcCommit(1,hSvcUuid,hSvc)
18+
rc=BleServiceNew(1, BleHandleUuid16(svcUuid), hSvc)
1919
//Initialise char, write/read enabled, accept signed writes, indicatable
2020
rc=BleCharNew(0x6A,charUuid,charMet,mdCccd,0)
2121
//Commit char initialised above, with initial value "hi" to service 'hMyChar'
2222
rc=BleCharCommit(hSvc,attr$,hMyChar)
23+
//Commit the service
24+
rc = BleServiceCommit(hSvc)
2325
rc=BleScanRptInit(scRpt$)
2426
//Add 1 service handle to scan report
2527
rc=BleAdvRptAddUuid16(scRpt$,hSvc,-1,-1,-1,-1,-1)
@@ -103,7 +105,7 @@ IF OnStartup()==0 THEN
103105
rc = BleCharValueRead(hMyChar,at$)
104106
PRINT "\nValue of the characteristic ";hMyChar;" is: ";at$
105107
PRINT "\nYou can write to the CCCD characteristic."
106-
PRINT "\nThe BL600 will then indicate a new characteristic value\n"
108+
PRINT "\nThe BL652 will then indicate a new characteristic value\n"
107109
PRINT "\n--- Press button 1 to exit"
108110
ELSE
109111
PRINT "\nFailure OnStartup"

UserGuideExamples/EvAuthSccD.sb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ IF OnStartup()==0 THEN
8585
rc = BleCharValueRead(hMyChar,at$)
8686
PRINT "\nCharacteristic Value: ";at$
8787
PRINT "\nYou can write to the SCCD attribute."
88-
PRINT "\nThe BL600 will then indicate a new characteristic value"
88+
PRINT "\nThe BL652 will then indicate a new characteristic value"
8989
PRINT "\n--- Press button 1 to exit\n"
9090
ELSE
9191
PRINT "\nFailure OnStartup"

UserGuideExamples/EvCharVal.sb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ DIM hMyChar,rc,at$,conHndl
66
//==============================================================================
77
FUNCTION OnStartup()
88
DIM rc, hSvc, attr$, adRpt$, addr$, scRpt$ : attr$="Hi"
9-
9+
1010
//commit service
11-
rc=BleSvcCommit(1,BleHandleUuid16(0x18EE),hSvc)
12-
rc=BleServiceNew(1, BleHandleUuid16(0x18EE), hSvc)
11+
rc=BleServiceNew(1, BleHandleUuid16(0x18EE), hSvc)
1312
//initialise char, write/read enabled, accept signed writes
1413
rc=BleCharNew(0x0A,BleHandleUuid16(1),BleAttrMetaData(1,1,20,0,rc),0,0)
1514
//commit char initialised above, with initial value "hi" to service 'hSvc'
1615
rc=BleCharCommit(hSvc,attr$,hMyChar)
17-
//commit changes to service
16+
//commit changes to service
1817
rc=BleServiceCommit(hSvc)
1918
rc=BleScanRptInit(scRpt$)
2019
//Add 1 service handle to scan report

UserGuideExamples/EvNotifyBuf.sb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ FUNCTION OnStartup()
1212
DIM mdCccd : mdCccd = BleAttrMetadata(1,1,2,0,rc) //CCCD metadata for char
1313

1414
//Commit svc with handle 'hSvc'
15-
rc=BleServiceNew(1, BleHandleUuid16(0x18EE), hSvc)
16-
rc=BleSvcCommit(1,BleHandleUuid16(0x18EE),hSvc)
15+
rc=BleServiceNew(1, BleHandleUuid16(0x18EE), hSvc)
1716
//initialise char, write/read enabled, accept signed writes, notifiable
1817
rc=BleCharNew(0x12,BleHandleUuid16(1),BleAttrMetaData(1,0,20,0,rc),mdCccd,0)
1918
//commit char initialised above, with initial value "hi" to service 'hMyChar'
2019
rc=BleCharCommit(hSvc,attr$,hMyChar)
21-
//commit changes to service
22-
rc=BleServiceCommit(hSvc)
20+
//commit changes to service
21+
rc=BleServiceCommit(hSvc)
2322
rc=BleScanRptInit(scRpt$)
2423
//Add 1 service handle to scan report
2524
rc=BleAdvRptAddUuid16(scRpt$,0x18EE,-1,-1,-1,-1,-1)

0 commit comments

Comments
 (0)