start / stop NFC programmatically

I am able to start / stop Bluetooth of cascades

Is there a way to start and stop the NFC by programming?

It has enabled for a business application in the perimeter of work where the NFC should automatically /disabled.

THX

Rodger,

Thanks again. It works well - even in the scope of work

Integrate this way:

At STARTUP after UI is created from a QTimer delayed in QML, I call checkNfcState:

void ApplicationUI::checkNfcState()
{
    mPpsObject = new bb::PpsObject("/pps/services/unifiedradiomgr/status?wait,delta", this);

    bool res = connect(mPpsObject, SIGNAL(readyRead()), this, SLOT(onPpsReadyRead()));
    Q_ASSERT(res);
    Q_UNUSED(res);
    if (!mPpsObject->open(bb::PpsOpenMode::Subscribe)) {
        qWarning() << "E K K E  Could not connect to Radio object: " << mPpsObject->errorString();
    }
}

and here's the SLOT:

void ApplicationUI::onPpsReadyRead()
{
    bool readOk;
    QByteArray data = mPpsObject->read(&readOk);
    if (!readOk) {
        qDebug() << "N F C  !readOk";
        return;
    }
    bool decodeOk;
    const QVariantMap map = bb::PpsObject::decode(data, &decodeOk);
    if (!decodeOk) {
        qDebug() << "N F C  !decodeOk";
        return;
    }
    const QVariantMap ppsFile = map["@status"].toMap();
    if (ppsFile.isEmpty()) {
        qDebug() << "N F C  !ppsFile.isEmpty";
        return;
    }

    QString state;
    state = "nfc";
    if (ppsFile.contains(state)) {
        QString nfcValue = ppsFile[state].toMap()["state"].toString();
        qDebug() << "N F C   current   STATE: " << nfcValue;
        if(nfcValue == "OFF") {
            emit nfcOff();
        }
        disconnect(mPpsObject, SIGNAL(readyRead()), this, SLOT(onPpsReadyRead()));
        mPpsObject->deleteLater();
    }
    return;
}

As soon as I get a State NFC I disconnect subscription because there is already an NFC events bps events loop, where I'll be notified if NFC pass in review status:

void ApplicationUI::handleNfcEvent(bps_event_t *event)
{
    uint16_t code = bps_event_get_code(event);
    nfc_event_t *nfcEvent;
    nfc_target_t* target = NULL;
    nfc_result_t rc;
    uchar_t id[20];
    size_t idLength = 0;

    switch (code) {
        case NFC_TAG_READWRITE_EVENT:
            ....
            break;
        case NFC_SNEP_CONNECTION_EVENT: {
            ....
            break;
        case NFC_NDEF_PUSH_SUCCEED_EVENT: {
            ...
            break;
        case NFC_NDEF_PUSH_FAILURE_MSG_OVER_SIZE_EVENT: {
            ...
            break;
        case NFC_NDEF_PUSH_FAILURE_REJECTED_EVENT: {
            ...
            break;
        case NFC_NDEF_PUSH_FAILURE_IO_ERROR_EVENT: {
            ...
            break;
        case NFC_ON_EVENT:
            ...
            break;
        case NFC_OFF_EVENT:
            ...
            emit nfcOff();
            break;
        default:
            ...
            break;
    }

    // don't forget to delete the target
    if (target != NULL) {
        nfc_destroy_target(target);
    }
}

It works fine now.

As yet I had no information if there is a way to start the NFC programmatically open settings NFC detection NFC OFF if:

void ApplicationUI::nfcSystemSettings()
{
    InvokeRequest cardRequest;
    cardRequest.setUri("settings://nfc");
    cardRequest.setMimeType("settings/view");
    cardRequest.setAction("bb.action.OPEN");
    cardRequest.setTarget("sys.settings.card");
    mInvokeManager->invoke(cardRequest);
}

Tags: BlackBerry Developers

Similar Questions

  • Remote Start / Stop function

    I was wondering if Peter has any information about a remote starter / stop feature.

    How can I connect start function of my C-motion or Preston the camera remotely? I don't see any other than the 'Remote' normal connection points, but this only works with the RM-B150/170 - so don't not compatiable with LCS.

    I guess it's also possible that the stop and remote start could be addressed through the wi - fi connectivity when activated.

  • Start, stop, step chart generator

    I would like to get into the start, stop and frequency step to build a table that will contain the value of to feed to a sweep generator.

    I have something that works, except for one thing; the timeout value. I can't get this thing to stop on the stop frequency value. The step value seems to affect it too much. So could someone take a look at my vi and help me with this? In addition, the code seems a bit complex for what might seem like a simple thing to do.

    Anyway, here's a slightly simpler implementation of your code. As you can see, you the codes was much more complicated than necessary!

    Below is the implementation of the model of ramp (recommended). Both give the same result for entries healthy of mind.

    I would certainly use the ramp model, because it has the better error handling (for example if the delta is zero or maximum is + Inf, etc.).

    You can view the code to learn something.

    You will need to pay attention to possible accumulations of bit errors, especially with fractional steps that cannot be fully represented in binary (e.g. 0.1)

  • Order of generation of the signal with the command START/STOP (State Machine approach)

    Hello

    I met the problem with the realization of control (START/STOP) signal generation using state machine.

    There are 4 States in the computer status (see 4 screenshots below).

    The problem is when I click the button START, only a short series of generated pulses.

    What is the staff of task_in/task_out issue, which is not properly managed?

    Thanks in advance

    Pavel.

    Oh... you have defined with the mechanical switch action up to published... Right click and go to mechanical Action > latch when released. Do the same for your Start button.

    You took a second to read down hold value, because your writing acquisition takes on this subject for a long time, apparently.

    The stop button the Application, I did switch when set to released. It is set to the switch so that it can be used as a local variable in the Acquisition State stop as Idle.

    Here's more info on mechanical actions.

  • Photosmart C6180 problem of Power-Up/Power-Down - loops on/stop/start/stop etc.

    I had the C6180 Photosmart wireless connected to a Mac OS X 10.5.6 laptop Macbook Intel and IBM PC XP SP 2 for more than 2 years.  I did have major problems with the printer.

    Recently, I have known a couple of electric in my house.  Since then the printer has turned off randomly once or twice.  Today the printer began to turn off/on/off/on/turned off/turned on etc.

    It lights up and shows the HP logo and process bar animation for one minute, followed by the message: "abnormal termination.  To avoid damage on the button to turn off the printer.  Do not use a wall or the band switch to close.  Press OK.  Then he stops and leaves upward.

    I tried to enter batch Mfg mode by organizing the * and # keys.  It flashes "Mfg commands - enter special Key Combo" for the second of two, then stops and makes a loop on/stop/start/stop again and again.

    I have disconnected all data cables, installs the printer in another room, closes the wifi on both computers and connected directly to the wall on a different circuit to eliminate problems of low power as the culprit.  I swapped the power cable between the wall and the block of the AC adapter with the same exact type of cord of another piece of equipment with the same results.

    I wonder if it is a symptom of a surfboard logic damaged in the printer, or a problem with the AC adapter?

    If it is the logic board, does pay to get it fixed?  An equivalent printer for Mac would cost about $200.  Not to mention that I came just to have stored on cartridges.

    What is a likely indication of a problem of brick AC adapter?  If so, should I spring for a replacement block AC adapter for $30?

    I was not able to find this question in a post on the forum and I was wondering if it's 'Au revoir' to the C6180?

    Thank you for your contribution to this number

    Try this:

    1. If the printer is still on, unplug all rigid and flexible cables at the back of the printer.

    2 unplug the power cord also from the wall...

    3. wait for two minutes.

    4 reconnect the power cord to a wall outlet first.

    5. hold the pound (#) and six 6 buttons.

    6. all by pressing the two buttons, reconnect the power cord to the back of the printer and at the end of two seconds, exit book and six buttons.

    7. turn on the printer if it goes out...

    Let me know the results.

  • How to use 1-channel analog input for start/stop aquire sample second channel input analog?

    I have a little problem. I've just been programming in labview for 2 weeks.

    I'm trying to figure out how to use my channel of analog input on the USB-6009 case for start/stop (reference trigger and start) presented to the second analog input channel samples.

    I need the first analog input string to operate continuously and control sampling on the second.  When the second channel will start sampling program brings a new graph each time and saves it (I have all this that figure out).

    How can I configure the trigger so the lance program presented in for the second channel when the 1 channel reached above 2V (e.g.) and stop when it falls below 2V.

    I use a pressure force sensor on the first channel that gives me straight (up to) 5 V when it is pressed and nothing when it is not...

    Thank you.

    Grand... Thanks for the information!

    But can't I then make a 1 channel instead and wait until that meat of the max element value?

  • XP Internet vidio run start stop smoothly the Rafale in short reading.

    Vidio XP Internet do not work correctly when you click on vidio execution pauses and starts, stops and starts its really slow?

    Looks like it is buffering. Either wait a few minutes until you press play, download the video to your hard drive and then watch, make sure you go to your internet connection at full capacity, so try to use maybe a wired network instead of wireless, I sometimes look less people will use internet or upgrade to a better download speed of your internet provider.

  • Windows XP lost Standby Option of start / stop

    original title: gardeningwithgusto

    I tried to make my fujitzu computer run faster and update some files.  Subsequently start/stop, the option ensures the menu drop-down disappeared.  All that remained was logout, restart and stop.

    Thank you

    Hello

    I suggest you follow the troubleshooting steps form the article and check if it helps.

    Standby missing from the shut down Windows dialog box

    http://support.Microsoft.com/kb/188134

  • Why - Windows live mail and Windows live album veiwer keep start/stop?

    Please can someone help.

    Why Windows live mail and Windows live album viewer repeatedly keep start/stop?

    I am running windows vista Home premium computer laptop, and it's so boring.

    Concerning

    Silverfox161

    Hello

     
    See the link and check if it helps:
    Windows Live Photo Gallery crashes or won't start

    http://support.Microsoft.com/kb/944221

    If you're still having problems with Windows Live Mail and Photo Gallery, I suggest you to send your query in the links given to improve assistance.
    http://windowslivehelp.com/product.aspx?ProductID=15
    http://windowslivehelp.com/product.aspx?ProductID=20
  • Vostro 200 Mini Tower trying to start, stops, then resumes

    Vostro 200 Mini Tower trying to start, stops, then repeats until you press the power button to interrupt the cycle.

    The power button is orange and fixed

    The blue disk activity light

    MOBO is lit

    All the fans (CPU, GPU, PSU, case) work

    Removed and reinstalled video card

    Deleted and reinstalled memory modules

    Power connectors to reinstalled MOBO

    Battery replaced CMOS

    All connectors are firmly connected, and yet there seems to be no power to the screen or keyboard.

    I disconnected the power, drained residual power and reconnected the power.  The cycle continues.

    I would appreciate any other suggestions on what I can try (as - why the screen and keyboard are not powered by the computer).

    Thank you.

    RJ318

    The power supply could be good, it is best to test with a unit of work "known."

    My thoughts are, interestingly, spend the money on a 9 +-system years?

    But you can buy a motherboard Dell refurbished/used OEM for $24.99 + S & H from here:

    https://www.Amazon.com/Dell-motherboard-Inspiron-systems-compatible/DP/B003CO0WQS

    Note: Unfortunately, while you can make an informed diagnosis, sometimes computer troubleshooting, is diagnosis by substitution.

    Bev.

  • OBIEE Linux Start &amp; Stop Script - OEL6

    Hello

    I try to use the next time you start & stop the Script in 6 OEL. It does not work. What changes do I work for 6 OEL.

    http://www.rittmanmead.com/2012/01/scripted-Obi-11g-Linux-startupshutdown/

    I have a DEV environment which is OEL 5. It works very well there. All entries are appreciated.

    Thank you

    Vincent

    (a) use http://ritt.md/init.d instead - this post you cite is now outdated (I'll update to reflect this). This post here shows how to set up a server OL6.

    (b) ' it doesn't' do not help us to solve any problems you have. Error message, steps to reproduce etc.  How to ask Questions the Smart way

  • VMs of automatic start/stop on power loss

    Hello! I know that this has been covered at the front (and I read these threads/documents/etc), but I still have questions. Forgive my ignorance!

    So far I have activated it so:

    Capture1.PNG

    But virtual machines under 'Autostart' is still not auto-start. I then found that HA can be a factor (if it is enabled, you can not auto-start/stop VMs). However, it is currently in a State of N/A:

    Capture2.PNG

    Each VM has this same State N/A as well (and VM Tools are installed on each of them, if it matters). I have not any clusters or whatever it be listed under the House, so I can't understand where really disable HA:

    Capture3.PNG



    Looks like you run ESXi 5.0 Update 1, and only in this version there was a bug that made the autostart VM does not...

    Upgrade to a later patch the 5.0 (or better to 6.0?) level to solve the problem.

    More info is here: vSphere Hypervisor Auto Start Bug fixed - VMware vSphere Blog - Articles from VMware

  • Automatic start/stop for guest settings keep reproduce every time I access the properties

    Greetings,

    I have a single ESXi host 5.5 with a single Win 2012 std server prompt.   I have a second guest, but is not in production. Several months ago I "thought" I activated the auto start and stop for this particular customer.  Due to problems of food in the building today, I had the opportunity to stop the comments and the turning off of the host completely.   After the reboot of the host, my guest, never started (automatically). I connected to the host via vsphere client and started manually.  No problems.

    I decided to check the settings of automatic start/stop and it is set to manual.  So, either I never actually put it on automatic (and I just have problems of memory in my head (not unusual for me)) or I put it really, and something happened where he became disabled or brought back to the default value.

    That said, I went to properties of start-up automatic and as mentioned above, found it turned off, I was able to allow him, but when he returned to the screen (after clicking OK), it displays TWO of each of my virtual machines in the Autorun screen.  I went back to see if I could change/delete/remove the extras (I've found a way to do it), and when I came back out of the screen there are THREE virtual computers listed in the pane. See attachment.  Anyone know what is happening here and how can I remedy the situation?

    Am I just being a fool and lack of obvious?

    Thank you.

    P....

    Autostart.jpg

    Exit the VSphere client and restart it solved the problem.  I presume a video type of bug, or maybe a bug with my version of the client.

  • Start &amp; stop an instance RAC

    Hello

    I just created a 2 node 11 GR 2 database RAC, traditionally from databases not CARS I would just use sqlplus to start / stop the instance

    Q1. What is the recommended way to start / stop an instance in a RAC environment? Do you use a cluster to do command, or is sqlplus is acceptable?

    Q2. If you use sqlplus and more to stop an instance on a node, I presume that the cluster services is NOT as a failure and so don't try to restart the instance?

    Q3. similiarly what is the best way to start / stop a listener on a particular node?

    any help appreciated

    Jim

    Hello Jim,

    Q1. What is the problem with the status not reflected in the output of clusterware resource? Is it to do with the ability of Services to acknowledge a failure and restart the CLuster service?

    Response: The resource database is not parsed by SIR and if the database suddenly stops then none will try to restart the same.

    Q2. Regarding the automatic closing of a database in a CCR environment (as opposed to the manual method which I asked on-) if I simply turn off the cluster nodes of my will which in turn stops the Instances and close the database RAC itself (when the last Instance is closed)?

    For even if I turn on my knots, the first node start cluster, its instance and open the database?

    Answer: well, if you turn off your server then of course the database and stop anything else running on the server. When the server is under tension and if crs autostart is enabled then the clusterware stack will come with the server

    Q3. What is the difference between a Service and a resource of the cluster? Are the database, earphone etc services or resources? I'm just trying to understand why SVRCTL is used to manipulate the database and listener and not say CRSCTL?

    Answer: You can configure a service which is part of tree resources of database and the resource database is a parent for the same thing. Services are used to connect to the database. Database, (if added) services, asm, listener, scan etc are all the resources of the clusterware, which are monitored by the clusterware.

    You can refer to the Oracle documentation, which will give you more insight on these details

    http://docs.Oracle.com/CD/E11882_01/RAC.112/e16794/TOC.htm

    http://docs.Oracle.com/CD/E11882_01/RAC.112/e16795/TOC.htm

    Kind regards

    Vautrin - Oracle

  • 11 GR 2 Grid Infrastructure manual start/stop in clustered environment

    Hello

    I have installation 11 GR 2 grid in both a stand-alone environment and a cluster environment and I am looking at some differences regarding post-market manually in these two environments

    In the stand-alone environment, manually stop really just composed of-

    ASM - stop I would use generally "srvctl stop asm ' to do

    Stopping HAS (Oracle Restart) - using "crsctl stop at".

    Would be just the reverse of these

    However things in the clustered environment seem to be a whole different kettle of fish!

    First of all I appreciate this start manual switch of ASM and Cluster resource (in stand-alone environments and Clustered) is not really essential for the operation on the day the day (it's really for food issues) and a server startup or stop will do the necessary start / stop services - so somehow this manual process is a bit contrived for the race on the day the day

    Q1. Given that there are so many different levels of process / demons for the clustered environment - is there still a viable manual start for 11 GR 2 GI procedure in a clustered environment?

    Any help in identifying the manual order to start / stop would be appreciated?

    Thank you

    Jim

    Hello

    You can stop/start the cluster and all resources with "crsctl stop/start crs. There is no need to manually stop the asm, it will be managed by clusterware, as well as the dbs, auditors, etc.

    You can use "crsctl stat res t ' for an overview of the resources managed by the crs.

    "crsctl stat res ora.your_dbname.db Pei" gives you detailed information about the resource, including the start and stop option. Regularly, this should be the immediate mode for the dbs, if you're fine with this mode of closure you can simply use crsctl stop crs to stop everything on a single node.

    Concerning

    Thomas

Maybe you are looking for