Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 12-21-2005
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
IceStorm available for Ice-E?

I currently have a position tracking application that runs on Windows CE and Linux devices.

I would like to port this application to be an IceStorm publisher. Is this possible using Ice-E?

There is no reference to IceStorm in the Ice-E source.
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com
Reply With Quote
  #2 (permalink)  
Old 12-21-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Welcome to the forum!

It is possible to create an IceStorm publisher using Ice-E. In order to do this, you will need to translate the IceStorm Slice file using slice2cppe.

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 12-21-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
In case it's not clear, here is how you can translate the IceStorm Slice file, assuming the Ice Slice files are installed in /opt/Ice/slice:

$ slice2cppe -I/opt/Ice/slice --ice /opt/Ice/slice/IceStorm/IceStorm.ice

Hope that helps.
- Mark
Reply With Quote
  #4 (permalink)  
Old 12-21-2005
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
I will give it a try.

Thanks for the reply.
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com
Reply With Quote
  #5 (permalink)  
Old 12-22-2005
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
I managed to build a simple IceStorm publisher for my embedded linux platform (gumstix - http://www.gumstix.com).

First I build Ice-E for the gumstix. Because development for the gumstix takes place using cross-compiler tools I had to make the following modifications:

1. Edit config/Make.rules.Linux and add "ifeq ($(CXX),arm-linux-g++) ..." for the cross compiler.

2. Edit include/IceE/Config.h to specify the endian for the gumstix platform.

Then sliced the IceStorm ice files:

$ slice2cppe -I<Ice src path>/slice --ice <Ice src path>/slice/IceStorm/IceStorm.ice
$ slice2cppe -I<Ice src path>/slice --ice <Ice src path>/slice/SliceChecksumDict.ice

I then simply compiled the resulting IceStorm.cpp and SliceChecksumDict.cpp into my application.

The only problem I have encountered is with doubles.

My slice file is:

struct Position
{
byte unit;
long time;
double lat;
double lon;
int track;
double pitch;
double roll;
byte satCount;
bool averaged;
};

interface Monitor
{
void report( Position p );
};
In the struct Position the members arrive at the subscriber correctly EXCEPT the data members that are doubles.

If I build the publisher on the same platform as the subscriber (Fedora Core 4 x86) then the doubles arrive ok.

Any suggestions what I might be doing wrong?
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com
Reply With Quote
  #6 (permalink)  
Old 12-22-2005
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
It could be a problem with 'double' on your embedded platform.

Did you try to run the IceE/operations test (or any simple program that uses double parameters) between your embedded system and Ice-E on FC4?

Did you try with float instead of double?

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #7 (permalink)  
Old 12-22-2005
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
After further investigation I have discovered the following:

simple IceE embedded client -> simple IceE embedded server ...... doubles ok
simple Ice FC4 client -> simple IceE embedded server ...... doubles NOT ok
simple IceE FC4 client -> simple IceE embedded server ...... doubles NOT ok
IceE embedded publisher -> Ice FC4 subscriber ..... doubles NOT ok.

It is as if the packing or unpacking of doubles is not working when 2 different hosts are involved....

All of the IceE test work on my embedded platform except for the AliveTest in the thread test suit which fails with:

AliveTest.cpp:98: assertion `!c.isAlive()' failed
Aborted
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com
Reply With Quote
  #8 (permalink)  
Old 12-22-2005
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Steven,

After a little google search, it appears that doubles on ARM (or at least some ARM versions) have a special representations: the two words are big-endian even on small-endian platforms.

Note that current Linux/ARM is not an Ice-E supported platform. However I am unsure whether this issue affects Windows CE on ARM (a supported platform) or not... I am unable to verify right now.

Could you try to update the marshaling and demarshaling of doubles in src/IceE/BasicStream.cpp?

I suspect it should be something like:

Code:
void
IceInternal::BasicStream::write(Double v)
{
    Container::size_type pos = b.size();
    resize(pos + sizeof(Double));
    Byte* dest = &b[pos];
#ifdef ICE_BIG_ENDIAN
    const Byte* src = reinterpret_cast<const Byte*>(&v) + sizeof(Double) - 1;
    *dest++ = *src--;
    *dest++ = *src--;
    *dest++ = *src--;
    *dest++ = *src--;
    *dest++ = *src--;
    *dest++ = *src--;
    *dest++ = *src--;
    *dest = *src;
#else
    const Byte* src = reinterpret_cast<const Byte*>(&v);
#   if defined(_ARM_) // use the right macro here!
     dest[4] = *src++;
     dest[5] = *src++;
     dest[6] = *src++;
     dest[7] = *src++;
     dest[0] = *src++;
     dest[1] = *src++;
     dest[2] = *src++;
     dest[3] = *src;
     dest += 7;
#   else
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest = *src;
#   endif
#endif
}


void
IceInternal::BasicStream::read(Double& v)
{
    if(b.end() - i < static_cast<int>(sizeof(Double)))
    {
	throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
    }
    const Byte* src = &(*i);
    i += sizeof(Double);
#ifdef ICE_BIG_ENDIAN
    Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Double) - 1;
    *dest-- = *src++;
    *dest-- = *src++;
    *dest-- = *src++;
    *dest-- = *src++;
    *dest-- = *src++;
    *dest-- = *src++;
    *dest-- = *src++;
    *dest = *src;
#else
    Byte* dest = reinterpret_cast<Byte*>(&v);
#   if defined(_ARM_) // Use the right macro here
    dest[4] = *src++;
    dest[5] = *src++;
    dest[6] = *src++;
    dest[7] = *src++;
    dest[0] = *src++;
    dest[1] = *src++;
    dest[2] = *src++;
    dest[3] = *src;
    dest += 7;
#   else
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest = *src;
#   endif
#endif
}
This code is obviously completely untested! Please let me know if it makes a difference ... if it works, you'll have to fix the marshaling/demarshaling of vector<double> as well (in the same file).

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #9 (permalink)  
Old 12-22-2005
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
Hi Bernard.

I will give your code change a try when back at work early in the new year. I will post the results in this thread.

I appreciate the help that you and Mark have given me for this problem.

Regards

Steven
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com
Reply With Quote
  #10 (permalink)  
Old 01-08-2006
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
Hi Bernard.

Your code change suggestion works just fine.

Thanks again for your help.

Steven
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com
Reply With Quote
  #11 (permalink)  
Old 01-09-2006
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Steven,

I am glad this worked out!

For the benefit of other Ice-E users, could you describe the platform you're using (Linux version, GCC version, hardware)? Did you need to change anything else to run Ice-E on that platform?

Thanks,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #12 (permalink)  
Old 01-10-2006
sbrydon sbrydon is offline
Registered User
 
 
Join Date: Dec 2005
Posts: 7
The gumstix device is based on the Intel PXA255 XScale processor. More information can be found at: http://www.gumstix.com

The gumstix device runs version 2.6.10 of the linux kernel.

All development is performed using cross compiler tools e.g GCC 3.4.2. More details of the gumstix SDK can be found at:
http://www.gumstix.org/tikiwiki/tiki...ge=programming

Below is a description of the steps I had to take to enable me to build the IceE system and IceStorm based applications on the gumstix embedded linux platform.

Modify the following files in the IceE source tree:

src/IceE/BasicStream.cpp
as described by Bernard in post 8 of this thread
config/Make.rules.Linux
added #ifeq($(CXX),arm-linux-g++) define to cope with the gumstix cross compiler.
added CXXFLAGS += -DGUMSTIX_DOUBLE to the section added in the previous step.
config/Make.rules
modified to build static libs
include/IceE/Config.h
define ICE_LITTLE_ENDIAN if architecture is unknown
The IceE libs where then simply compiled by:
CXX=arm-linux-g++ make
To allow IceStorm applications to be built I produced the appropriate source files by:

$ slice2cppe -I<Ice src path>/slice --ice <Ice src path>/slice/IceStorm/IceStorm.ice
$ slice2cppe -I<Ice src path>/slice --ice <Ice src path>/slice/SliceChecksumDict.ice
I then simply compiled the resulting IceStorm.cpp and SliceChecksumDict.cpp into my application.
__________________

Steven Brydon
Virtual Spectator International
http://www.virtualspectator.com

Last edited by sbrydon : 01-10-2006 at 12:13 AM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown property "IceBox.DBEnvName.IceStorm" for IceStorm wwwtiger Help Center 1 11-05-2004 03:23 PM


All times are GMT -4. The time now is 10:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.