You are on page 1of 3

Mock-ril: Install: Install protoc see the external/protobuf/INSTALL.txt and external/protobuf/python/README.txt. The short answer is: $ $ $ $ $ $ $ cd external/protobuf .

/configure make make check make install cd python python setup.py install

If you get "from google.protobuf import xxxx" statements that google.protobuf is not found you didn't install the python support for protobuf. Also on Mac OSX I got an error running the protoc tests but installing was fine. Running/testing: See "Testing a new ril:" below for general instructions but for the mock-ril I've added some targets to the Makefile to ease testing. Execute the "first" target first to setup appropriate environment: $ cd hardware/ril/mock-ril $ make first If changes made to ".proto" files run make with the default "all" target: $ make If changes are made to "c++" file create a new library and run the "test" target: $ mm $ make test If changes to only the execute "js" target: $ make js To run the test control server: $ make tcs Implementation: The mock-ril is a library where the ril is implemented primarily in javascript, mock-ril.js. In addition it can be controlled by sending messages from another computer to port 54312 (TODO make programmable) to the ctrlServer, a Worker in In mock-ril.js. See mock_ril.js for additional documentation. files: ctrl.proto ctrl.* ctrl_pb2.py ctrl_server.* Protobuf messages for the control server Protobuf generated files. Python files generated from ctrl.proto Cpp interface routines between ctrlServer

experiments.* js_support.* logging.h mock_ril.[cpp h] mock_ril.js node_buffer.* node_object.* node_util.* protobuf_v8.* requests.* responses* ril.proto ril_vars.js ril_pb2.py status.h tcs.py util.* worker.* worker_v8.* TODO: more documentation. Testing a new ril:

in javascript and the controller. Early experiments Java script support methods. Exposes various routines to javascript, such as print, readFile and include. LOG_TAG and include utils/log.h Main module inteface code. The mock ril A Buffer for communicating between c++ and js. This was ported from nodejs.org. An object wrapper to make it easier to expose c++ code to js. Ported from nodejs.org. Some utilities ported from nodejs.org. Protobuf code for javascript ported from http://code.google.com/p/protobuf-for-node/. Interface code for handling framework requests. Interface code for handling framework responses. The protobuf version of ril.h Some additional variables defined for enums in ril.h. Python files generated from ril.proto. STATUS constants. Test the ctrlServer. Utility routines Define WorkerThread and WorkerQueue. Expose WorkerQueue to js.

The Makefile is used to generate files and make testing easier. I has several targets: all clean first test runs protoc and generates files, ril.desc ril.pb.* target removes generated files. changes to root, remounts r/w and copies some files. copies the latest libmock_ril.so and kills rild to run the new mockril

General instructions for testing ril's: 1) On the device login in as root and remount file system so it's read/write: $ adb root restarting adbd as root $ adb remount remount succeeded 2) Set rild.libpath to the name of the ril: adb shell setprop rild.libpath /system/lib/libmock_ril.so Using setprop makes the change temporary and the old ril will be used after rebooting. (Another option is to set rild.libpath in /data/local.prop, but don't forget to reboot for it to take effect).

3) Compile and copy the ril to /system/lib/: adb push out/target/product/passion/system/lib/libmock_ril.so /system/lib/ 4) To restart the ril, kill the currently running ril and the new one will automatically be restarted. You can use the ps command to find /system/bin/rild PID, 3212 below and kill it: $ adb shell ps grep rild radio 3212 1 3224 628 ffffffff afd0e4fc S /system/bin/rild $ adb shell kill 3212 5) Make modifications, go to step 3.

You might also like