Skip to content
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.

Commit

Permalink
Fixed issues with mailHandler on devices powered by CIQ 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
voltangle committed May 18, 2021
1 parent 6e55173 commit 4ef3cd4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
launcherIcon="@Drawables.LauncherIcon"
name="@Strings.AppName"
type="watch-app"
version="2.1.0"
version="2.0.5"
minSdkVersion="1.2.0">
<iq:products>
<iq:product id="fr945" />
Expand Down Expand Up @@ -38,6 +38,5 @@
<iq:language>eng</iq:language>
<iq:language>rus</iq:language>
</iq:languages>
<iq:barrels/>
</iq:application>
</iq:manifest>
2 changes: 1 addition & 1 deletion source/WheelLogCompanionApp.mc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WheelLogCompanionApp extends Application.AppBase {

// onStart() is called on application start up
function onStart(state) {
Communications.setMailboxListener(method(:mailHandler));
Communications.registerForPhoneAppMessages(method(:phoneAppMessageHandler));

// Initiating some runtime cache variables
AppStorage.runtimeCache["comm_disconnectionCountdown"] = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ using Toybox.Communications;
using Toybox.WatchUi;
using Toybox.Attention;

function mailHandler(mailIter) {
var mail;
mail = mailIter.next();
function phoneAppMessageHandler(message) {
var data = message.data;
Communications.emptyMailbox();

if (mail != null) {
if (data != null) {
// Play connection tone
if (Attention has :playTone) {
Attention.playTone(ToneProfiles.appConnectionTone);
}

// Assign the server port
WheelData.webServerPort = mail;
WheelData.webServerPort = data;

// And set connection state
WheelData.setIsAppConnected(true);
Expand Down

0 comments on commit 4ef3cd4

Please sign in to comment.