1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-binding/OsmoCore.st

91 lines
2.5 KiB
Smalltalk

"Copyright placeholder"
Eval [
"Handle reloading the OsmoCore.st file for updates"
Namespace current at: #OSMOCore ifPresent: [ :each |
OSMOCore logNotice: 'OSMOCore is getting updated.' area: #osmocore.
OSMOCore stopProcess
].
]
Object subclass: OSMOCore [
<comment: 'I provide lowlevel access libosmocore.so.0'>
<category: 'libosmocore'>
Process := nil.
OSMOCore class >> initialize [
DLD addLibrary: 'libosmocore.so.0'.
ObjectMemory addDependent: self.
]
OSMOCore class >> poll [
| delay |
delay := Delay forMilliseconds: 50.
[true] whileTrue: [
self bsc_select_main: 1.
delay wait.
].
]
OSMOCore class >> startProcess [
"I start a new polling process"
Process := [
self poll.
] fork.
]
OSMOCore class >> stopProcess [
"I will terminate the process"
Process ifNotNil: [
Process terminate.
Process := nil.
]
]
OSMOCore class >> update: aSymbol [
"Check if the BSC Symbols are there again?"
self logDebug: '#>>update: called' area: #osmocore
]
OSMOCore class >> bsc_select_main: poll [
self logDebug: '#>>bsc_select_main: called' area: #osmocore
<cCall: 'bsc_select_main' returning: #int args: #(#int) >
]
OSMOCore class >> processEvents [
self bsc_select_main: 1
]
OSMOCore class >> msgb_length: aMsg [
self logDebug: '#>>msgb_length: called' area: #osmocore
<cCall: 'msgb_length' returning: #uInt args: #(#cObject) >
]
OSMOCore class >> msgb_data: aMsg [
self logDebug: '#>>msgb_data: called' area: #osmocore
<cCall: 'msgb_data' returning: #cObject args: #(#cObject) >
]
OSMOCore class >> msgb_free: aMsg [
self logDebug: '#>>msgb_free: called' area: #osmocore
<cCall: 'msgb_free' returning: #void args: #(#cObject) >
]
OSMOCore class >> gsm0480_create_ussd_resp: invokeId trans: transId text: aText [
self logDebug: '#>>gsm0480_create_ussd_resp: called' area: #osmocore
<cCall: 'gsm0480_create_ussd_resp' returning: #cObject args: #(#int #int #string) >
]
OSMOCore class >> gsm0808_prepend_dtap_header: msg linkId: aId [
self logDebug: '#>>gsm0808_prepend_dtap_header: called' area: #osmocore
<cCall: 'gsm0808_prepend_dtap_header' returning: #void args: #(#cObject #uInt) >
]
]
Eval [
OSMOCore initialize.
]