QWF services script (qwf.sh)

Start or stop QWF services

Syntax:

qwf.sh start crm model device interface vendor_id product_id
             bus_number device_number &   

qwf.sh stop [crm]

Runs on:

QNX Neutrino

Options:

bus_number
Bus number (as a hexadecimal string) for the USB modem module.
crm
Name of the QWF Cellular Resource Manager (CRM) executable found in /base/bin. The target image always contains one of two CRM executables: qwf-crm-telit (if your configuration uses a Telit modem) or qwf-crm-gemalto (if you're using a Gemalto modem).
device
USB device entry in /dev to use for the data connection (e.g., serusb5).
device_number
Device number (as a hexadecimal string) for the USB modem module.
interface
Name of the data interface (e.g., ppp0, msm0, ecm0).
model
Model number of the USB modem module or dongle (e.g., le910, le920, he910, l200).
product_id
Product ID (as a hexadecimal string) for the USB modem module.
vendor_id
Vendor ID (as a hexadecimal string) for the USB modem module.

Description:

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.

Note: We recommend that you don't modify any system scripts or configuration files without first consulting QNX Technical Support. Sensitive runtime issues may arise if scripts or configuration files are altered.

Disabling QWF Voice Services

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}

Starting and stopping QWF services with usblauncher

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:

  1. Edit your /etc/usblauncher/rules.lua file.
  2. Insert the following at the top of the file:
    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
    
  3. Insert the following at the bottom of the file:
    -- 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