2010-09-09 14:39:13 +00:00
|
|
|
"Copyright placeholder"
|
|
|
|
|
2010-09-10 17:49:40 +00:00
|
|
|
Eval [
|
|
|
|
"Handle reloading the OsmoCore.st file for updates"
|
|
|
|
Namespace current at: #OSMOCore ifPresent: [ :each | OSMOCore stopProcess ].
|
|
|
|
]
|
|
|
|
|
2010-09-09 14:39:13 +00:00
|
|
|
Object subclass: OSMOCore [
|
2010-09-10 17:49:40 +00:00
|
|
|
<comment: 'I provide lowlevel access libosmocore.so.0'>
|
|
|
|
<category: 'libosmocore'>
|
|
|
|
|
|
|
|
Process := nil.
|
|
|
|
|
2010-09-09 14:39:13 +00:00
|
|
|
OSMOCore class >> initialize [
|
|
|
|
DLD addLibrary: 'libosmocore.so.0'.
|
|
|
|
ObjectMemory addDependent: self.
|
|
|
|
]
|
|
|
|
|
2010-09-10 17:49:40 +00:00
|
|
|
OSMOCore class >> startProcess [
|
|
|
|
"I start a new polling process"
|
|
|
|
| delay |
|
|
|
|
delay := Delay forMilliseconds: 500.
|
|
|
|
|
|
|
|
Process := [
|
|
|
|
[true] whileTrue: [
|
|
|
|
self bsc_select_main: 1.
|
|
|
|
" delay wait."
|
|
|
|
].
|
|
|
|
] fork.
|
|
|
|
]
|
|
|
|
|
|
|
|
OSMOCore class >> stopProcess [
|
|
|
|
"I will terminate the process"
|
|
|
|
Process ifNotNil: [
|
|
|
|
Process terminate.
|
|
|
|
Process := nil.
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-09-09 14:39:13 +00:00
|
|
|
OSMOCore class >> update: aSymbol [
|
|
|
|
"Check if the BSC Symbols are there again?"
|
|
|
|
]
|
|
|
|
|
|
|
|
OSMOCore class >> bsc_select_main: poll [
|
|
|
|
<cCall: 'bsc_select_main' returning: #int args: #(#int) >
|
|
|
|
]
|
|
|
|
OSMOCore class >> processEvents [
|
|
|
|
self bsc_select_main: 1
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
Eval [
|
|
|
|
OSMOCore initialize.
|
2010-09-10 17:49:40 +00:00
|
|
|
OSMOCore startProcess
|
2010-09-09 14:39:13 +00:00
|
|
|
]
|