Embedded Automation Forum  

Go Back   Embedded Automation Forum > mHome Products > mControl Application Notes > Using the mControl Mobile Client
Forums FAQ Members List Calendar Search Today's Posts Mark Forums Read

Using the mControl Mobile Client Tips and tricks on how to use the mControl Mobile Client

Thread Tools Display Modes
Old 02-22-2011, 07:32 PM
franzr franzr is offline
Join Date: Oct 2009
Posts: 33
Default Tiny mobile .aspx to run a macro

I'm trying to write a tiny .aspx file which, when loaded, simply runs a macro. This way when I'm on my way home and I have spotty cell coverage I have the best chance of being able to run my "coming home" macro. Below is what I have to run macro 17, basically I just took the mobile.aspx file, yanked out the body, and put in a call to SendCommand. No matter what I try it won't run...any help would be greatly appreciated!!!

<%@ Page language="c#" ASPCompat="true" Codebehind="Mobile.aspx.cs" AutoEventWireup="false" Inherits="mControl.Mobile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<title>mControl - Mobile</title>
<meta name="viewport" content="width = 240" />
<link rel='Shortcut Icon' href='images/common/favicon.ico' />
<link rel="stylesheet" type="text/css" href="styles/mobile/blue_static.css"/>
<script src="scripts/mobileBasicFunctions.js" type="text/javascript"></script>
<script src="scripts/mobileEventsLogic.js" type="text/javascript"></script>
<script type="text/javascript">
<% Response.Write(API.Command.viewzones_data_js); %>
<script src="scripts/mobile_logic.js" type="text/javascript"></script>
<script src="scripts/mobileCommon.js" type="text/javascript"></script>
<script src="scripts/mobileLightObject.js" type="text/javascript"></script>
<script src="scripts/mobileCameraobject.js" type="text/javascript"></script>
<script src="scripts/mobileThermostatObject.js" type="text/javascript"></script>
<script src="scripts/mobileSecurityObject.js" type="text/javascript"></script>
<script src="scripts/mobileMainStatus.js" type="text/javascript"></script>

<body class="bodyClass" id="body" onload='bodyLoad()'>
<script type='text/javascript'>
document.write("Ran the macro!");
Reply With Quote
Old 02-22-2011, 07:57 PM
franzr franzr is offline
Join Date: Oct 2009
Posts: 33
Default Getting closer

OK, I got it to work by adding calls to PopulateDevices() and PopulateMacros() before making the SendCommand() call. While this is an improvement, I still have to load 153kb of data on my phone before it runs. On a sketchy data connection this can take some time, or even not work at all. Does anyone know of a way to invoke a macro with very minimal data transfer?

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:37 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.