Hello every friend,

Could I spare you a few minutes? :) My Teammates and I have learned to develop 
an application using B200mini on Android. We followed Mr. Tom Trondeau 
instructions on http://gnuradio.org/redmine/projects/gnuradio/wiki/Android that 
very helpful for our work.
Here are some questions to consult. I would be greatly appreciated if you can 
reply them.

We modified some lines of code of GrRxFM project.
In RunGraph.java if we use the function mConnection.postMessage() to send 
parameter to GNURadio block,  it does work.  We modified the handleMessage 
function like this.

public void handleMessage(Message m) {
            Bundle b = m.getData();
            if(b != null) {
                HashMap<String, RPCConnection.KnobInfo> k =
                        (HashMap<String, RPCConnection.KnobInfo>) 
b.getSerializable("HashMap");

                HashMap<String, Double> usrpHashMap =
                        (HashMap<String, Double>) 
b.getSerializable("UsrpHashMap");

                Log.d("RunGraph", "Set Knobs: " + k);
                if((k != null) && (!k.isEmpty())) {
                    mConnection.setKnobs(k);

                   List<String> arg=new ArrayList<>();
                   arg.add("gr uhd usrp source0::freq");
                   Map<String,RPCConnection.KnobInfo> 
info=mConnection,getKnobs(arg);
                }

                if(usrpHashMap != null) {
                    Set usrpSet = usrpHashMap.entrySet();
                    for (Object anUsrpSet : usrpSet) {
                  //      Map.Entry e = (Map.Entry) anUsrpSet;
                //        mConnection.postMessage(USRP_SOURCE_NAME, 
//USRP_COMMAND_NAME,             (String) e.getKey(), (Double) e.getValue());
                    }
                }
            }
        }

And We modified some lines of OnCreate() function. We commented postMessage() 
function and use postSetKnobMessage(setKnobs) to send command to GNURadio block.

        HashMap<String, Double> usrpKnobs = new HashMap<>();
        HashMap<String, RPCConnection.KnobInfo> setKnobs = new HashMap<>();

        Double dFreq=Double.parseDouble(freq) * 1e6;
        RPCConnection.KnobInfo ki=new RPCConnection.KnobInfo("gr uhd usrp 
source0::freq",dFreq,BaseTypes.DOUBLE);
        setKnobs.put("gr uhd usrp source0::freq",ki);

      //  usrpKnobs.put("freq", 1e6*Double.parseDouble(freq));
      //  usrpKnobs.put("gain", Double.parseDouble(gain));
        postSetKnobMessage(setKnobs);
      //  postMessage(usrpKnobs);

However the mConnection.setKnobs(k) function didn't work, the frequency didn't 
change and mConnection,getKnobs(arg) returned nothing .
We guess the command  "gr uhd usrp source0::freq" is wrong.

Is there a command list of GNURadio block to refer?

 Thank you so much.



sincerely Charlie
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to