Start or stop QWF services
qwf.sh start crm model device interface vendor_id product_id bus_number device_number & qwf.sh stop [crm]
QNX Neutrino
The QWF reference image includes a Korn shell script, qwf.sh, for starting and stopping wireless services. When starting these services, the script takes several parameters, including the name of the resource manager executable to use for the modem type, the model number of the USB modem module, and several vendor-specific fields. For instance, you can start QWF services for a Telit LE910 modem module with this command:
qwf.sh start qwf-crm-telit le910 serusb5 ppp0 0x1bc7 0x1201 0 0x03
When stopping QWF services, the crm parameter (which specifies the resource manager executable) is optional, and no other parameters are required. If you don't provide the crm parameter, the script searches the list of active processes for one with a suitable name (e.g., qwf-crm-*) and slays that process.
You can view the usage message, which contains examples for the start and stop commands, by providing the -h argument to the script.
By default, all wireless services in the QWF Data and QWF Cellular Voice modules are started by qwf.sh. You can disable the launching of voice services by commenting out the relevant commands in the script file, by adding the comment delimiter (#) to the front of these lines, as follows:
# cellular services ${BINS_DIR}/${CELLULAR_SERVICES} & print ${CELLULAR_SERVICES} $! > /dev/shmem/${CELLULAR_SERVICES}.run print $(cat < /dev/shmem/${CELLULAR_SERVICES}.run) >> ${QWF_RUNNING} # phone service (before voice) #${BINS_DIR}/${PHONE_SERVICE} & #print ${PHONE_SERVICE} $! > /dev/shmem/${PHONE_SERVICE}.run #print $(cat < /dev/shmem/${PHONE_SERVICE}.run) >> ${QWF_RUNNING} # voice service #${BINS_DIR}/${VOICE_SERVICE} & #print ${VOICE_SERVICE} $! > /dev/shmem/${VOICE_SERVICE}.run #print $(cat < /dev/shmem/${VOICE_SERVICE}.run) >> ${QWF_RUNNING} # cellular resource manager ${BINS_DIR}/${crm_name} -M ${modem_model} & print ${crm_name} $! > /dev/shmem/${crm_name}.run print $(cat < /dev/shmem/${crm_name}.run) >> ${QWF_RUNNING}
The QWF reference image uses the usblauncher service (which is part of the QNX SDP platform) to detect the insertion or removal of USB modem modules and to automatically invoke qwf.sh to start or stop wireless services as needed.
QWF includes a LUA script file, /etc/usblauncher/qwf.lua, that launches QWF services with specific resource manager and device parameters, based on the type of cellular modem that was connected through USB. The shipped version of the main usblauncher configuration file (/etc/usblauncher/rules.lua) includes the QWF LUA script. If you have your own rules.lua file, you might need to modify it to include qwf.lua, so that usblauncher launches the QWF services.
To automate the starting and stopping of QWF services through usblauncher:
CONFIG_DIR = "/base/etc/usblauncher/"; function file_exists(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end
-- QWF rules QWF_RULES = CONFIG_DIR .. "qwf.lua"; if file_exists(QWF_RULES) then print("usblauncher: Including QWF rules in " .. QWF_RULES); dofile(QWF_RULES); end