Commit graph

1892 commits

Author SHA1 Message Date
ehouse
bf3ccf1bad Remove unused FindTrustedDevice calls; don't try to become master or slave
until we know which we'll be.  This likely fixes the problem where devices
have trouble connecting after switching roles.
2007-12-07 09:50:48 +00:00
ehouse
244e600afa call util_addrChange prior to closing comms to fix crash moving from
BT to standalone game; add a couple of similar assertions; up beta
version.
2007-12-07 07:50:19 +00:00
ehouse
f70bdb54ae Remove excessive focus logging; fix timer bug for BT by posting event so EvtGetEvent can exit 2007-12-06 05:26:44 +00:00
ehouse
3a85db7b38 Rewrite of checkIncomingStream to be cleaner and fix bug with initial messages getting dropped
while heartbeat feature was enabled.  Fixed the problem on Linux, but experience on Treo650
is still better without HB feature, so turning it off on Palm.  This seems ready for beta,
but will test a bit more.
2007-12-05 06:33:37 +00:00
ehouse
036294a42e Comments only. 2007-12-05 06:31:30 +00:00
ehouse
3013b89b03 Don't respawn if child died in less than a second. 2007-12-05 06:30:45 +00:00
ehouse
c2ad749f99 Change util function to use signed type; other cleanup to compile with various features. 2007-12-05 06:28:51 +00:00
ehouse
e4b01a514b Change state icon even when not doing work to get it to show up (unconnected) earlier. 2007-12-05 06:26:21 +00:00
ehouse
0d5543b28f Fix dialog title; send heartbeat based on when connected even if no
messages yet received; reset bt connection on palm in two stages;
remove unused param.  Change version number for beta.
2007-12-03 01:20:32 +00:00
ehouse
6ed33b8914 Log BT lib version -- toward refusing to run or alerting user of broken Treo650 (version 1). 2007-12-03 01:18:59 +00:00
ehouse
e894a44b61 Fix compilation errors. Not tested. 2007-12-03 01:18:13 +00:00
ehouse
86fa3159d6 Don't use uninitialized values as port numbers; use match for set as well as get. 2007-12-03 00:45:09 +00:00
ehouse
bd1222f2dc Fix bug showing remote/robot moves only on host to include client too. 2007-12-02 22:07:24 +00:00
ehouse
b527110379 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +00:00
ehouse
c10a3a7340 Start adding ability to listen on multiple sockets and to dynamically
change the set listened on.  There's still some debugging to do but
nothing that worked before is broken.  Also begin to accept unique
prefixes (e.g. g for get) for commands and attributes on the control
port.  Note that relay-related code in comms seems broken now, but is
without this checkin.
2007-12-01 15:00:30 +00:00
ehouse
75b42f36c3 Add files forgotten with last checkin; add additional parameter to
addListener so listeners can be removed on reset.
2007-11-28 03:59:26 +00:00
ehouse
42615345c9 Re-add direct-via-ip transport, and implement for linux in order to
better test heartbeats.  Fix so can play against Palm over BT.
Assertions failing on Linux when reset, but it's otherwise done.
2007-11-26 02:58:25 +00:00
ehouse
044a889d6d Don't draw negative number of tiles left. 2007-11-25 15:12:22 +00:00
ehouse
4e335550a7 Add file and line number to debug version of realloc and free. 2007-11-22 05:04:40 +00:00
ehouse
c03afb2eb3 Exit on unexpected params; better testing when launching; use bash to create pid file. 2007-11-22 04:59:11 +00:00
ehouse
321acd1d42 Add and set a compile-time option so comms will set a periodic timer
and use it to send and check for heartbeats over any transport.
Caller must supply a reset proc which is called when heartbeat hasn't
been received in too long.  No changes required to comms protocol, but
that means the heartbeat interval is fixed at compile time: can't be
negotiated, and the two ends had better agree.  Currently tested with
linux host and PalmOS guest, where only the first heartbeat failure is
recovered from.  So there's some debugging to be done still.
2007-11-18 23:43:27 +00:00
ehouse
a91056bed2 Make cooperation in a heartbeat scheme a compile-time option. This is
meant to allow comms to take over heartbeats.
2007-11-18 23:38:56 +00:00
ehouse
f752eace94 Fix bug reassembling packets; advance credit on each send/receive.
With this checkin rfcomm works between two Treos and between Treos and
linux, though with plenty of bugs around reconnecting yet to find.
However, it turns out that even using rfcomm a Treo650 gives no notice
to the other device when shutting down the connection, so rfcomm
doesn't help.  Rfcomm is probably not worth using, but the code's now
here and can be turned on in the Makefiles.
2007-11-18 17:57:28 +00:00
ehouse
476e164aa1 Deal with incoming fragmented rfcomm packets; log packet contents. 2007-11-15 14:40:56 +00:00
ehouse
0cdd8a41c4 Add code, disabled in Makefile, to use rfcomm rather than l2cap for
data with the goal of detecting disconnects more quickly.  Stops
working after a few packets (client only tested against host on linux
so far), and doesn't compile for ARM yet, but the framework is there.
Am framing packets on Palm side which may not be necessary.
2007-11-15 14:39:33 +00:00
ehouse
bcb25d96b2 fix oversized font when scoreboard miniwindow has two lines. 2007-11-14 05:57:12 +00:00
ehouse
29bb6a7ca9 quick hack at framing rfcomm packets 2007-11-14 05:53:28 +00:00
ehouse
5d3e641082 Add ability via compile-time flag to connect via rfcom rather than
l2cap.  Works with two caveats: assumes l2cap-style complete packets
(no framing), and has problems with linux sdp system's tendency to
retain records long after sessions are closed.
2007-11-13 15:20:33 +00:00
ehouse
938a90634f fix new compiler warnings; daemonize, and add handler to kill child if
parent dies so that script can kill based on pid file.
2007-11-13 03:53:10 +00:00
ehouse
be0005667f init.d style script for starting and stopping relay 2007-11-13 03:50:41 +00:00
ehouse
4fb097369e Fix reconnect bug: when master's in initial state but listening socket
already inited, shift state to listening
2007-11-10 17:54:05 +00:00
ehouse
f99f718997 Turn on self-spawning: main loop should never crash but exists only to
respawn child when it does.  Add crash command to test this.  Add
ability to set logging level from ctrl port.
2007-11-10 05:41:49 +00:00
ehouse
0cfaa44292 Add English strings as starting point for translation 2007-11-08 05:18:04 +00:00
ehouse
d1054a52ff Use a single general-purpose callback passed into palm_bt_doWork where
it's needed, removing those passed into _init and _send.  When client
is unable to connect to host, raise alert to user and give choice to
continue trying.  Clear 'suspendBT' flag when user manually resends or
opens different game.  Currently this happens only on guest's failure
to find registered SDP; should also extend to remote device not
running at all and to host failure to send to guest.
2007-11-07 13:40:56 +00:00
ehouse
a3ef550426 Use fixed action queue and memcpy rather than rotating buffer; eliminate sequential duplicates of most actions. 2007-11-06 04:05:11 +00:00
ehouse
b7044a2dab Fix typo breaking compile. 2007-11-05 03:42:27 +00:00
ehouse
ebd158ef35 Update BT code to advertise and search sdp records and use psm reported to work with new Palm
code.  Log btaddr after converting from name.
2007-11-05 03:38:00 +00:00
ehouse
81aa3f9d2e Update BT code to advertise and search sdp records and use psm reported to work with new Palm
code.  Get rid of pthreads dependency which was for logging only.
2007-11-05 03:17:07 +00:00
ehouse
9f1d02c7cd Byte-swap psm field to callback on ARM: now both client and host work. Move SDP-related constants out where linux can use too. 2007-11-03 22:04:06 +00:00
ehouse
38a7c6a87e Fix tray hanging below main window; draw pending tiles white-on-black as on other platforms. 2007-10-24 12:46:15 +00:00
ehouse
d929af49ad Instead of three fixed-sized fonts, choose fonts (lazily) based on the size of the rect into which it's to be drawn. 2007-10-23 03:08:47 +00:00
ehouse
6e8a1922eb Add ARM support for functions and types required for UUID/PSM lookup.
Almost works: if the ARM build is running as host, all's well; but if
it's client, gets btLibL2DiscConnPsmUnsupported after trying to make
an l2c connection.
2007-09-30 17:33:19 +00:00
ehouse
b289d291f9 move LOG_OFFSET 2007-09-30 17:22:38 +00:00
ehouse
302abd3be5 fix log_hex to print nibbles in right order. 2007-09-27 02:56:35 +00:00
ehouse
57baefaf5f Publish (master) and look for (slave) SPD record so that we're looking for our app and not just BT when connecting. I hoped this would prevent T650s from crashing when nothing's running. It doesn't, but it's the right way to connect, and will allow better error messages or retry logic. Compiles only on 68K at the moment. 2007-09-15 13:50:07 +00:00
ehouse
9f7d69aec6 Turn BT back on as default and up version preparing for next release. 2007-09-15 13:47:28 +00:00
ehouse
e5d5584a04 add logging to help catch a recurring assertion 2007-09-15 13:46:59 +00:00
ehouse
25ae118c4f up version number for dot release. 2007-08-27 12:43:26 +00:00
ehouse
28dc5c7d38 If we get keyUp event, override earlier determination that this device doesn't get them. This works around Tungsten double-key bug. Better fix will be to use the right FtrGet constants to set generatesKeyUp. 2007-08-22 02:36:13 +00:00
ehouse
47c3b0f7bd add fnav resource for password dialog, and use it if device has fiveway.
Otherwise use FrmSetFocus.  This works around a bug where key event that
leaks through from parent dialog dismisses dialog (whereupon another comes
up, and eventually cursor is left flashing on parent.)
2007-06-18 13:21:36 +00:00