Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (22 sloc) 0.993 kB

Android Receiver

Description

Listen for broadcast messages from android-notifer coming over a specific port. Parse the message, format it, and hand it off to a handler function.

This was done mostly as a learning exercise in C.

Usage

android-receiver &

Setup

Two constants are defined at the top of android-receiver.c:

  • PORTNO is the port number to listen on (10600 is android-notifier's default)
  • HANLDER will be executed with the formatted message passed as the first argument when one is receieved.

You can find the dzen2 handler I'm using in my scripts repo. You could also write your own wrapper around gnome-dbus, notify-osd, etc.

My machine is setup to block TCP broadcast packets as per Arch's "Simple stately firewall". Rather than change this setting, I've elected to setup the notifier app on my phone to send a UDP packet to a specific IP address instead.

That is what this program expects.

Jump to Line
Something went wrong with that request. Please try again.