Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6821059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:29:59+00:00 2026-05-26T21:29:59+00:00

I have to dash away from the computer frequently, and I want to trigger

  • 0

I have to dash away from the computer frequently, and I want to trigger some commands to run when my iPhone is close enough/far enough from my iMac (next to it vs. 2-3 metres away/other side of a wall). A couple of minutes latency is fine.


Partial solution: proximity

I’ve downloaded reduxcomputing-proximity and it works, but this only triggers when the device goes in to/out of range of bluetooth, but my desired range is much smaller.

(Proximity polls [IOBluetoothDevice -remoteNameRequest] to see if the device is in bluetooth range or not.)

Enhancement: rawRSSI

I’ve used [IOBluetoothDevice -rawRSSI] to get the RSSI when I am connected to the iPhone (when disconnected this just returns +127), but in order to save the battery life of my iPhone I’d rather avoid establishing a full bluetooth connection.

Am I correct in thinking that maintaining a connection will consume more battery life than just polling every couple of minutes?

I’ve overridden the isInRange method of proximity here to give me a working solution that’s probably relatively battery intensive compared to the previous remoteNameRequest: method:

- (BOOL)isInRange {
    BluetoothHCIRSSIValue RSSI = 127; /* Valid Range: -127 to +20 */
    if (device) {
        if (![device isConnected]) {
            [device openConnection];
        }
        if ([device isConnected]) {
            RSSI = [device rawRSSI];
            [device closeConnection];
        }
    }
    return (RSSI >= -60 && RSSI <= 20);
}

(Proximity uses synchronous calls – if and when I fit it to my needs I will edit it to be asynchronous but for now that’s not important.)


Under Linux: l2ping – inquiry scan?

This SO post references getting an RSSI during an ‘inquiry scan’ which sounds like what I want, but it talks about using the Linux Bluez library, whilst I am on a Mac – I’d rather do it without having to stray too far if possible! (I have considered using a VM with USB pass-thru to hook up a second bluetooth device… But a simpler solution would be preferable!)

I see there is a IOBluetoothDeviceInquiry class, but I am not sure if this is useful to me. I don’t intend to learn bluetooth protocol just for this simple problem!


The commands

For interest, and not particularly relevant to the solution, here are the Apple Scripts I currently trigger when

in range:

tell application "Skype"
    send command "SET USERSTATUS ONLINE" script name "X"
    do shell script "afplay '/System/Library/Sounds/Blow.aiff'"
end tell

out of range:

tell application "Skype"
    send command "SET USERSTATUS AWAY" script name "X"
    do shell script "afplay '/System/Library/Sounds/Basso.aiff'"
end tell

Though these are likely to get longer!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:30:00+00:00Added an answer on May 26, 2026 at 9:30 pm

    In terms of tradeoffs for your use case doing a continuous or periodic inquiry will consume same or even a bit more energy as doing a periodic connect / read RSSI and disconnect. Depending on the use case it sometimes may be more efficient to maintain the connection in a low power mode (sniff with 2.56 sec interval) and remain connected if the device is in range. And use RSSI to monitor proximity (although it is not accurate as interference due to objects change rssi drastically even though the device might be in proximity)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem how do i replace a single dash(-) with a single
I have list of strings like this FirstName-Lastname (separated by a dash -) I
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I have a LineChart and I can plot with different Stroke Dash Array but
I have two apps, one runs in namespace com.gtosoft.voyager and the other is com.gtosoft.dash.
I have the following code that I am playing with: <script type=text/javascript> var Dash
I have this string ($str) : 67-89-90T , and I want to keep 67-89
I have downloaded the MPDs http://dash.edgesuite.net/adobe/hdworld_dash/HDWorld.mpd and all related .m4s files. I tried running
I have a url: http://localhost/40ATV/dashboard.php?page_id=projeto_lista&lista_tipo=equipe I want to get the address after the last
I have a 2d Boolean array and I want to dynamically create it's size

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.