×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    47

    Exclamation cellid data is not comig?

    Hi all,
    i am working with 5800 xpress music phone.i am running cell id example.when i click to get cellid the cell id is undefiend.i amn't getting what is the problem:

    mycode:
    var so;
    function setup(){
    try {
    so = device.getServiceObject("Service.SysInfo", "ISysInfo");
    console.info("setup: so: %s", so);
    }
    catch (e) {
    alert('<setup> ' +e);
    }
    }
    /*function cellid(){
    var entity = "Network";
    var key = "CellID";
    var criteria = new Object();
    criteria.Entity = entity;
    criteria.Key = key;

    try {
    var result = so.ISysInfo.GetInfo(criteria);
    //alert(result.toString());
    alert(result.ReturnValue);
    }
    catch (e) {
    alert ("getSysInfo: " + e);
    }
    }*/

    function cellid(){
    var criteria = new Object();
    criteria.Entity = "Network";
    criteria.Key = "CellID";

    try {
    var result = so.ISysInfo.GetInfo(criteria);
    var Div = document.createElement("div");
    Div.innerHTML +="<span>"+result.ReturnValue+"</span>";
    //Div.innerHTML +="Ok";
    document.getElementById('cellid').appendChild (Div);
    } catch (e) {
    alert ("Exception: " + e);
    }
    }

    function cellCallback(transId, eventCode, result){
    var Div = document.createElement("div");
    Div.innerHTML +="<span>"+result.ReturnValue+"</span>";
    //Div.innerHTML +="Ok";
    document.getElementById('cellid').appendChild (Div);
    }



    please give me idea how to get cellid.

    response is
    result.return:undefiend.
    errcode:1012

    Thanks
    Mehraj.
    Last edited by mehraj123; 2009-04-08 at 14:23. Reason: add

  2. #2
    Registered User
    Join Date
    Sep 2008
    Location
    Manaus, Brazil
    Posts
    109

    Smile Re: cellid data is not comig?

    Hi,


    your code has two problems. The first problem is
    var result = so.ISysInfo.GetInfo(criteria); it's not correct, because get CellID you need get a notification. Therefor, you need use var result = so.ISysInfo.GetNotification, ok?

    The other problem is the var result = so.ISysInfo.GetNotification is a asynchronous method. The code below will work in your device. If you try to use in emulator, It doesn't work.


    Code:
    function getCELLID(){
        try {
            var so = device.getServiceObject("Service.SysInfo", "ISysInfo");
            var criteria = new Object();
            criteria.Entity = 'Network';
            criteria.Key = 'CellID';
            alert("GetCellID")
            
            var result = so.ISysInfo.GetNotification(criteria, function(transId, eventCode, result){
            
                if (eventCode == 4) {
                    alert("Error " + result.ErrorCode + ": " + result.ErrorMessage);
                    return;
                }
                alert("ok");
                alert(result);
                alert(result.ReturnValue);
                alert(result.ReturnValue.Status);
            });
        } 
        catch (e) {
            return null;
        }
    }
    Last edited by jzferreira; 2009-04-08 at 20:26. Reason: error tag

Similar Threads

  1. Data Call on Nokia 6600 (ETel/RCall) problem
    By NSDev in forum Symbian C++
    Replies: 9
    Last Post: 2010-06-10, 12:39
  2. Replies: 2
    Last Post: 2008-07-03, 15:29
  3. Replies: 4
    Last Post: 2006-08-30, 10:15
  4. Replies: 2
    Last Post: 2006-08-11, 20:51
  5. Unicode Song Title In NSM Ringtone
    By mcai7db3 in forum Smart Messaging
    Replies: 3
    Last Post: 2002-08-28, 06:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •