diff -Nru biblesync-1.1.2/CMakeLists.txt biblesync-1.2.0/CMakeLists.txt --- biblesync-1.1.2/CMakeLists.txt 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/CMakeLists.txt 2018-04-19 00:05:31.000000000 +0000 @@ -6,7 +6,7 @@ # - INCLUDEDIR (default "CMAKE_INSTALL_PREFIX/include") - set to directory where header files should be installed # - BIBLESYNC_SOVERSION (defaults to BIBLESYNC_VERSION) - Manually set the SOVERSION of the installed file PROJECT(libbiblesync CXX) -SET(BIBLESYNC_VERSION 1.1.2) +SET(BIBLESYNC_VERSION 1.2.0) # A required CMake line CMAKE_MINIMUM_REQUIRED(VERSION 2.8) # Where our custom Find* files are located @@ -94,7 +94,7 @@ # End of copy from Sword's code ########################################################################################## -# Set the SOVERSION of the package, for binary compatability tracking +# Set the SOVERSION of the package, for binary compatibility tracking INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/soversion.cmake") # Set the variables in the .in file diff -Nru biblesync-1.1.2/debian/changelog biblesync-1.2.0/debian/changelog --- biblesync-1.1.2/debian/changelog 2018-11-01 07:33:13.000000000 +0000 +++ biblesync-1.2.0/debian/changelog 2018-11-09 09:09:30.000000000 +0000 @@ -1,3 +1,11 @@ +biblesync (1.2.0-1) unstable; urgency=high + + * d/docs: updated readme + * d/watch: updated for github + * new upstream version 1.2.0 + + -- Teus Benschop Fri, 09 Nov 2018 10:09:30 +0100 + biblesync (1.1.2-5) unstable; urgency=high * dh_missing fail-missing diff -Nru biblesync-1.1.2/debian/docs biblesync-1.2.0/debian/docs --- biblesync-1.1.2/debian/docs 2018-11-01 07:33:13.000000000 +0000 +++ biblesync-1.2.0/debian/docs 2018-11-09 09:09:30.000000000 +0000 @@ -1,2 +1,2 @@ -README +README.md WIRESHARK diff -Nru biblesync-1.1.2/debian/watch biblesync-1.2.0/debian/watch --- biblesync-1.1.2/debian/watch 2018-11-01 07:33:13.000000000 +0000 +++ biblesync-1.2.0/debian/watch 2018-11-09 09:09:30.000000000 +0000 @@ -1,3 +1,3 @@ # Compulsory line, this is a version 3 file version=3 -http://sf.net/gnomesword/biblesync-(.*)\.tar\.gz +https://github.com/karlkleinpaste/biblesync/releases/ .*/biblesync-([\d\.]+)(?:-[\d]+)?\.tar\.gz diff -Nru biblesync-1.1.2/include/biblesync.hh biblesync-1.2.0/include/biblesync.hh --- biblesync-1.1.2/include/biblesync.hh 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/include/biblesync.hh 2018-04-19 00:05:31.000000000 +0000 @@ -97,10 +97,8 @@ // // - send navigation. // BibleSync_xmit_status retval = -// Transmit(BSP_SYNC, -// "NASB", "John.3.16", "some alt ref", -// "1", "BIBLE-VERSE"); -// params: type (sync only), bible, ref, alt-ref, group, domain. +// Transmit("NASB", "John.3.16", "some alt ref", "1", "BIBLE-VERSE"); +// params: bible, ref, alt-ref, group, domain. // all params have defaults. // => it is the application's responsibility to send well-formed verse // references. @@ -110,6 +108,16 @@ // sets outgoing TTL to zero so no one hears you off-machine. // applicable only to BSP_PERSONAL mode. // +// - set beacon count based on frequency of calling Receive() +// void setBeaconCount(int); +// how often will your app call Receive()? +// divide 10 by that, call setBeaconCount(result). +// +// - set new username +// void setUser(string); +// for apps (such as Bishop) which allow the user to set the friendly name +// and which may be changed at some point whle BibleSync runs. +// // - allow another speaker to drive us // void listenToSpeaker(bool listen, string speakerkey) // say yes/no to listening. @@ -300,7 +308,8 @@ bool receiving; // when xmit-capable, we xmit BSP_BEACON every N calls of Receive(). - uint8_t beacon_countdown; + uint8_t beacon_countdown; // progress toward our next beacon xmit + uint8_t beacon_count; // how many Receive() calls between beacon xmits // track currently-known speaker set. BibleSyncSpeakerMap speakers; @@ -337,6 +346,15 @@ int ReceiveInternal(); // C++ object context. int InitSelectRead(char *, struct sockaddr_in *, BibleSyncMessage *); + // real transmitter. + BibleSync_xmit_status + TransmitInternal(char message_type = BSP_SYNC, + string bible = "KJV", + string ref = "Gen.1.1", + string alt = "", + string group = "1", + string domain = "BIBLE-VERSE"); + // speaker list management. void ageSpeakers(); void clearSpeakers(); @@ -376,18 +394,42 @@ static int Receive(void *myself); // assume C context: poll from timeout. // speaker transmitter - BibleSync_xmit_status Transmit(char message_type = BSP_SYNC, - string bible = "KJV", - string ref = "Gen.1.1", - string alt = "", - string group = "1", - string domain = "BIBLE-VERSE"); + // public interface permits only BSP_SYNC transmission. + // there is no reason for an app to send presence or beacon on its own. + inline BibleSync_xmit_status Transmit(string bible = "KJV", + string ref = "Gen.1.1", + string alt = "", + string group = "1", + string domain = "BIBLE-VERSE") + { + return TransmitInternal(BSP_SYNC, bible, ref, alt, group, domain); + } // set privacy using TTL 0 in personal mode. bool setPrivate(bool privacy); // say whether you want to hear from this speaker. void listenToSpeaker(bool listen, string speakerkey); + + // Speaker beacon must go out roughly every 10 seconds, + // set count to approx divisor. how often does your app call Receive()? + // every second, default 10. + // every 2 seconds, use 5. + // every 3 seconds, use 3 (9 seconds, fine). + // value is force-bounded [3..10]. + inline void setBeaconCount(uint8_t count) + { + if (count > 10) count = 10; + if (count < 3) count = 3; + beacon_count = count; + } + + // set new user name + // useful for apps that can change the name on the fly (e.g. Bishop). + inline void setUser(string u) + { + user = u; + } }; #endif // __BIBLESYNC_HH__ diff -Nru biblesync-1.1.2/INSTALL biblesync-1.2.0/INSTALL --- biblesync-1.1.2/INSTALL 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/INSTALL 2018-04-19 00:05:31.000000000 +0000 @@ -1,5 +1,5 @@ Linux: - $ mkdir build/linux && cd build/linux + $ mkdir -p build/linux && cd build/linux $ cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=/usr/lib64 ../.. $ make && sudo make install Note use of /usr/lib64, which is appropriate for Fedora x86_64; perhaps diff -Nru biblesync-1.1.2/man/biblesync.7 biblesync-1.2.0/man/biblesync.7 --- biblesync-1.1.2/man/biblesync.7 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/man/biblesync.7 2018-04-19 00:05:31.000000000 +0000 @@ -81,9 +81,7 @@ .br .BI "string BibleSync::getPassphrase(void);" .br -.BI "BibleSync_xmit_status BibleSync::Transmit(char " type "," -.br -.BI " string " bible ", string " ref ", string " alt "," +.BI "BibleSync_xmit_status BibleSync::Transmit(string " bible ", string " ref ", string " alt "," .br .BI " string " group ", string " domain ");" .br @@ -91,6 +89,8 @@ .br .BI "bool BibleSync::setPrivate(bool " privacy ");" .br +.BI "void BibleSync::setBeaconCount(uint8_t " count ");" +.br .BI "void BibleSync::listenToSpeaker(bool " listen ", string " speakerkey ");" .fi .SH DESCRIPTION @@ -216,9 +216,6 @@ Intended for use when preparing to enter any active mode, the application may request the current passphrase, so as to provide a default. .SS Transmit -The application must provide the message type, which in the normal case -should be -.I BSP_SYNC. The protocol requires all the indicated parameters, but all have defaults in .BI Transmit: @@ -238,6 +235,12 @@ single system, when in Personal mode, the application may also request privacy. The effect is to set multicast TTL to zero, meaning that packets will not go out on the wire. +.SS setBeaconCount +Beacon transmission occurs during every Nth call to Receive(); the default +value is 10. This presumes the application will call Receive() once per +second. If the application will call Receive() less frequently, divide +that time (say, 2 seconds) into 10 to get a value (5) to use with this +call. Use setBeaconCount() prior to enabling Personal or Speaker mode. .SS listenToSpeaker Aside from default listen behavior detailed above, the application specifically asks to listen or not to listen to specific Speakers. The diff -Nru biblesync-1.1.2/man/biblesync.7.txt biblesync-1.2.0/man/biblesync.7.txt --- biblesync-1.1.2/man/biblesync.7.txt 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/man/biblesync.7.txt 2018-04-19 00:05:31.000000000 +0000 @@ -47,8 +47,7 @@ BibleSync_mode BibleSync::getMode(void); string BibleSync::getVersion(void); string BibleSync::getPassphrase(void); - BibleSync_xmit_status BibleSync::Transmit(char type, - string bible, string ref, string alt, + BibleSync_xmit_status BibleSync::Transmit(string bible, string ref, string alt, string group, string domain); static int BibleSync::Receive(void *object); bool BibleSync::setPrivate(bool privacy); @@ -167,10 +166,8 @@ tion may request the current passphrase, so as to provide a default. Transmit - The application must provide the message type, which in the normal case - should be BSP_SYNC. The protocol requires all the indicated parame- - ters, but all have defaults in Transmit: KJV, Gen.1.1, empty alternate, - 1, and BIBLE-VERSE. + The protocol requires all the indicated parameters, but all have + defaults in Transmit: KJV, Gen.1.1, empty alternate, 1, and BIBLE-VERSE. Receive This is a static method accessible from either C or C++. It must be @@ -187,6 +184,14 @@ privacy. The effect is to set multicast TTL to zero, meaning that packets will not go out on the wire. + setBeaconCount + Beacon transmission occurs during every Nth call to Receive(); the + default value is 10. This presumes the application will call Receive() + once per second. If the application will call Receive() less + frequently, divide that time (say, 2 seconds) into 10 to get a value + (5) to use with this call. Use setBeaconCount() prior to enabling + Personal or Speaker mode. + listenToSpeaker Aside from default listen behavior detailed above, the application specifically asks to listen or not to listen to specific Speakers. The @@ -297,4 +302,4 @@ -Linux 2014-10-31 BIBLESYNC(7) +Linux 2018-04-10 BIBLESYNC(7) diff -Nru biblesync-1.1.2/README biblesync-1.2.0/README --- biblesync-1.1.2/README 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ ---------- -BibleSync ---------- - -This is a C++ single class library encapsulating a protocol conduit. The -premise is that there is a local network over which to multicast Bible -navigation, and someone, possibly several someones, will transmit, and -others will receive. The choices for when you decide to xmit and what to -do when you recv are up to you as the application designer. - -Access to the conduit is by creating the object, setting the mode, calling -Transmit() to xmit nav events, and arranging the frequent polling of -Receive() to recv nav events. There is more than just navigation to be -handled; there are live/dead events for potential Speakers as well as -mismatches, presence announcements, and errors. There is a programming -reference biblesync.7 which explains the details, both from a high level -view of the essentials of the protocol's behavior and at a low level of -how you create, access, and use the conduit class. The (single) BibleSync -object should persist throughout the life of your application, but at any -time you can set the mode to "disable," and preferably stop the receive -polling, and then re-enable it later as the user needs. - -Much work has been done in integrating this library into its first -application, Xiphos. It is useful to examine Xiphos' code to see where -and how integration has been done. Get a Xiphos source tree using... - svn checkout svn://svn.code.sf.net/p/gnomesword/code/trunk xiphos -...and see: -- main/biblesync-glue.* for incoming event handling and "glue" routines. -- main/sword.cc for initialization + how xmit is handled. -- gnome2/search_dialog.c and gnome2/sidebar.c for verse list xmit. -- gnome2/preferences_dialog.c and ui/prefs.glade for configuration UI. - -Karl Kleinpaste -May 2014 diff -Nru biblesync-1.1.2/README.md biblesync-1.2.0/README.md --- biblesync-1.1.2/README.md 1970-01-01 00:00:00.000000000 +0000 +++ biblesync-1.2.0/README.md 2018-04-19 00:05:31.000000000 +0000 @@ -0,0 +1,34 @@ +# BibleSync + +This is a C++ single class library encapsulating a protocol conduit. The +premise is that there is a local network over which to multicast Bible +navigation, and someone, possibly several someones, will transmit, and others +will receive. The choices for when you decide to xmit and what to do when you +recv are up to you as the application designer. + +Access to the conduit is by creating the object, setting the mode, calling +Transmit() to xmit nav events, and arranging the frequent polling of Receive() +to recv nav events. There is more than just navigation to be handled; there +are live/dead events for potential Speakers as well as mismatches, presence +announcements, and errors. There is a programming reference biblesync.7 which +explains the details, both from a high level view of the essentials of the +protocol's behavior and at a low level of how you create, access, and use the +conduit class. The (single) BibleSync object should persist throughout the +life of your application, but at any time you can set the mode to "disable," +and preferably stop the receive polling, and then re-enable it later as the +user needs. + +Much work has been done in integrating this library into its first application, +Xiphos. It is useful to examine Xiphos' code to see where and how integration +has been done. Get a Xiphos source tree using: + +~~~ +git clone https://github.com/crosswire/xiphos +~~~ + +...and see: + +- `main/biblesync-glue.*` for incoming event handling and "glue" routines. +- `main/sword.cc` for initialization + how xmit is handled. +- `gnome2/search_dialog.c` and `gnome2/sidebar.c` for verse list xmit. +- `gnome2/preferences_dialog.c` and `ui/prefs.glade` for configuration UI. diff -Nru biblesync-1.1.2/src/biblesync.cc biblesync-1.2.0/src/biblesync.cc --- biblesync-1.1.2/src/biblesync.cc 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/src/biblesync.cc 2018-04-19 00:05:31.000000000 +0000 @@ -25,7 +25,7 @@ // both inbound as well as outbound. // in these 2 arrays of strings, sync-specific // fields are placed after announce fields. -// see field_count in ReceiveInternal and Transmit. +// see field_count in ReceiveInternal + TransmitInternal. static string inbound_required[] = { BSP_APP_NAME, BSP_APP_INSTANCE_UUID, @@ -61,6 +61,7 @@ user(u), receiving(false), beacon_countdown(0), + beacon_count(BSP_BEACON_COUNT), mode(BSP_MODE_DISABLE), nav_func(NULL), passphrase("BibleSync"), @@ -196,7 +197,8 @@ // one way or another, if we got this far with a valid socket, // and the app is in a public mode, "TTL 0" privacy makes no sense. - if ((client_fd >= 0) && + if (ok_so_far && + (client_fd >= 0) && ((mode == BSP_MODE_SPEAKER) || (mode == BSP_MODE_AUDIENCE))) { @@ -254,8 +256,8 @@ // user to start faking his own beacons & nav using our uuid. if ((mode == BSP_MODE_PERSONAL) || (mode == BSP_MODE_SPEAKER)) { - Transmit(BSP_BEACON); - beacon_countdown = BSP_BEACON_COUNT; + TransmitInternal(BSP_BEACON); + beacon_countdown = beacon_count; // speaker mode => speaker list has become irrelevant. if (mode == BSP_MODE_SPEAKER) @@ -270,7 +272,7 @@ // now that we're alive, tell the network world that we're here. if (retval == "") - Transmit(BSP_ANNOUNCE); + TransmitInternal(BSP_ANNOUNCE); } return retval; @@ -616,7 +618,7 @@ // whether previously known or not, // a beacon (re)starts the aging countdown. speakers[pkt_uuid].countdown = - BSP_BEACON_COUNT * BSP_BEACON_MULTIPLIER; + beacon_count * BSP_BEACON_MULTIPLIER; new_speakers_size = speakers.size(); @@ -670,8 +672,8 @@ (mode == BSP_MODE_SPEAKER)) && (--beacon_countdown == 0)) { - Transmit(BSP_BEACON); - beacon_countdown = BSP_BEACON_COUNT; + TransmitInternal(BSP_BEACON); + beacon_countdown = beacon_count; } return TRUE; @@ -724,12 +726,13 @@ // speaker transmitter // sanity checks for permission to xmit, // then format and ship it. -BibleSync_xmit_status BibleSync::Transmit(char message_type, - string bible, - string ref, - string alt, - string group, - string domain) +BibleSync_xmit_status +BibleSync::TransmitInternal(char message_type, + string bible, + string ref, + string alt, + string group, + string domain) { if (mode == BSP_MODE_DISABLE) return BSP_XMIT_FAILED; diff -Nru biblesync-1.1.2/win32.opts biblesync-1.2.0/win32.opts --- biblesync-1.1.2/win32.opts 2014-12-19 15:26:47.000000000 +0000 +++ biblesync-1.2.0/win32.opts 2018-04-19 00:05:31.000000000 +0000 @@ -8,7 +8,7 @@ WIN32_OPTS="$WIN32_OPTS -DSHARE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw/share" WIN32_OPTS="$WIN32_OPTS -DCMAKE_SKIP_RPATH:BOOL=ON" WIN32_OPTS="$WIN32_OPTS -DBUILD_SHARED_LIBS:BOOL=ON" -WIN32_OPTS="$WIN32_OPTS -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake" +WIN32_OPTS="$WIN32_OPTS -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake" WIN32_OPTS="$WIN32_OPTS -DLIBBIBLESYNC_LIBRARY_TYPE=Shared" WIN32_OPTS="$WIN32_OPTS -DCMAKE_BUILD_TYPE=Debug" WIN32_OPTS="$WIN32_OPTS -DCROSS_COMPILE_MINGW32=TRUE" diff -Nru biblesync-1.1.2/win64.opts biblesync-1.2.0/win64.opts --- biblesync-1.1.2/win64.opts 1970-01-01 00:00:00.000000000 +0000 +++ biblesync-1.2.0/win64.opts 2018-04-19 00:05:31.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/sh +WIN64_OPTS= +WIN64_OPTS="$WIN64_OPTS -DCMAKE_VERBOSE_MAKEFILE=ON" +WIN64_OPTS="$WIN64_OPTS -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw" +WIN64_OPTS="$WIN64_OPTS -DCMAKE_INSTALL_LIBDIR:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib" +WIN64_OPTS="$WIN64_OPTS -DINCLUDE_INSTALL_DIR:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/include" +WIN64_OPTS="$WIN64_OPTS -DLIB_INSTALL_DIR:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib" +WIN64_OPTS="$WIN64_OPTS -DSHARE_INSTALL_PREFIX:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/share" +WIN64_OPTS="$WIN64_OPTS -DCMAKE_SKIP_RPATH:BOOL=ON" +WIN64_OPTS="$WIN64_OPTS -DBUILD_SHARED_LIBS:BOOL=ON" +WIN64_OPTS="$WIN64_OPTS -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw64.cmake" +WIN64_OPTS="$WIN64_OPTS -DLIBBIBLESYNC_LIBRARY_TYPE=Shared" +WIN64_OPTS="$WIN64_OPTS -DCMAKE_BUILD_TYPE=Debug" +WIN64_OPTS="$WIN64_OPTS -DCROSS_COMPILE_MINGW32=TRUE" +export WIN64_OPTS