 |
 |

Developer Connection
|
Archive for the ‘Development’ Category
June 9th, 2010, Author: guenter, Category: Announcements, Development, Release
The POCO C++ Libraries, as well as our commercial libraries and tools (Fast Infoset, Remoting, Open Service Platform), can now be used for Windows CE development as well. We have created a port of the POCO C++ Libraries to Windows CE 6 based on the current 1.3.7 branch. The port should work on Windows CE 5.x as well, however, testing has only been done on a Windows CE 6 device. There are a few minor restrictions to some POCO features, due to restrictions in the Windows CE operating system (e.g., no support for environment variables, no pipes), but apart from that, almost all libraries can be used.
Starting today, the Windows CE port is available to our support subscription customers and sponsors of the POCO C++ Libraries project upon request. If you’re not yet a support customer, you can become one here.
More information about the Windows CE port is available here.
May 16th, 2010, Author: guenter, Category: C++, Development, How-To, Remoting
Thanks to Apple’s excellent support of C++ on iPhone OS, Remoting is working fine on the iPhone, iPod Touch and iPad. The hardest thing when building a Remoting-based iPhone application is to integrate the necessary C++ libraries into the Xcode project. This article shows how to build an iPhone client that works with the Remoting-based Stock Quote Server sample shown in our first Remoting Screencast.
The first step is configuring and building the POCO C++ Libraries and Remoting framework for the iPhone (and, optionally, the iPhone Simulator). The POCO C++ Libraries and Remoting source code distribution come with a build configuration for building static libraries for the iPhone. Note that shared libraries are not supported on the iPhone, as there is no way to distribute them via the iPhone App Store. A standard POCO C++ Libraries distribution contains a few libraries that cannot be used on the iPhone, due to a lack of required third-party libraries. These are the Data/ODBC and Data/MySQL libraries. The Crypto and NetSSL_OpenSSL libraries require OpenSSL static libraries, which are not included in the standard iPhone SDK. If required, they can be built from the OpenSSL sources, though. On the iPhone, we do not need the Remoting code generator (it cannot run there anyway), so we leave it out as well. So we end up with the following steps to configure and build the libraries:
$ cd poco-2009.2p4
$ ./configure --config=iPhone --no-samples --no-tests
--omit=CppParser,CodeGeneration,Remoting/RemoteGen,
Crypto,NetSSL_OpenSSL,Data/ODBC,Data/MySQL
$ make -s -j4
If required, we can also build the libraries for the iPhone Simulator, by simply using the iPhoneSimulator build configuration instead of the iPhone build configuration. Note that the iPhoneSimulator build configuration is only available with release 2009.2p4 or later.
$ ./configure --config=iPhoneSimulator --no-samples --no-tests
--omit=CppParser,CodeGeneration,Remoting/RemoteGen,
Crypto,NetSSL_OpenSSL,Data/ODBC,Data/MySQL
$ make -s -j4
Now that the static libraries for the iPhone have been built, we can start building the iPhone application with Xcode. For this sample, we simply create a new iPhone application project based on the View-based Application template.
After creating the template, the first step is to add the necessary POCO and Remoting libraries to the project. This can be simply done by dragging the libraries from the poco-2009.2p4/lib/iPhoneOS/armv6 directory into the project’s Frameworks folder.

The next step is setting the header file and library search paths in the project’s settings.

For the library search paths, we want two separate search paths, one to be used when building for the iPhone, and another one to be used when building for the iPhone Simulator. This can be done by using build setting conditions in the project settings window.



After the search paths have been set up, we can start with the code. First, we need to register the Remoting Binary transport with the Remoting ORB. We do this in our application’s main() function. The main() function is implemented in file main.m. Since we’re going to mix C++ with Objective-C, we change the file’s extension to .M, which tells the compiler to assume Objective-C++ as source language.

Next, we add the Remoting client files generated by the Remoting code generator to the project. We simply use the files generated for the original client application — see the screencast for how to generate these files. Simply drag the header and source files into the project, and let Xcode copy them into the project directory.

We can now work on the application’s user interface. The application has a text field for entering a stock symbol, a button for sending a quote request for the symbol to the Remoting server, and a label for displaying the result. We also add the necessary actions and outlets to the view controller.

The final thing to implement is the getQuote() method in the view controller. This is the method that will use Remoting to send the stock quote request to the server. The important thing in this method is to catch all POCO-based exceptions, to avoid C++ exceptions spilling into the Cocoa framework. The necessary conversions from std::string to NSString and vice-versa are straightforward.

What’s left to do is some code to handle the text field input, and a few other things typical for iPhone applications. Please note that the file extension for the source file containing the controller has been changed to .M, as the file contains Objective-C++ code.
The final application can be seen below.

The complete source code for this application can be downloaded here. The source code for the server and command-line client can be downloaded here and here.
August 31st, 2009, Author: guenter, Category: Announcements, C++, Development, News
Last week we finished a first port of the POCO C++ Libraries to Windows Embedded CE (5.0 and later). The port is based on the upcoming 1.3.6 release, and is currently maintained in a separate code branch. Eventually (but not for 1.3.6), the CE branch will be integrated into the main branch. Currently, only Foundation, XML, Util and Net are available for Windows CE, but for the other libraries porting should simply be a matter of creating an appropriate project file for Visual Studio. For the port, we used Visual Studio 2008 with the Windows Mobile 6 SDK (which is based on CE 5.0).
If you want to try out the port, send us a quick message and we’ll send you the download link.
July 7th, 2009, Author: guenter, Category: Announcements, Development
Recently we have been working on two new transport implementations for Remoting. The first one is based on Unix Named Pipes and is really great for implementing object-based IPC on Unix/Linux platforms, as Named Pipes have less overhead than localhost sockets.
The other new transport is an extension of the existing Binary transport and allows for bidirectional communication. The main advantage of this transport is that the server can itself send requests to the client over the same socket connection the client uses to talk to the server. This is good for implementing asynchronous notifications from the server to the client – and since the existing client connection is used, this will also work across firewalls.
Both transport implementations will be part of an upcoming POCO Platform release. If you want to try these transports out now, get in touch with us.
May 22nd, 2009, Author: guenter, Category: Announcements, Development, Documentation
A new Quick Start Guide (PDF) for developers using the POCO Platform is available. This guide contains valuable information for first time POCO Platform users, including an overview of the POCO Platform, a guide to building the POCO Platform libraries and tools from the delivered source code, and tips for working effectively with the software. The document is still preliminary and a work-in-progress, but nevertheless quite useful already.
May 11th, 2009, Author: guenter, Category: Announcements, Development, Documentation, News
The 2009.1 release of the POCO Platform has been completed today. This release is based on the POCO C++ Libraries 1.3.5 release and features significant improvements to Remoting and OSP. Among the new features are improved integration of Remoting into OSP, a new OSP Shell service and support for signed bundles in OSP. Last but not least the documentation has been greately improved.
Customers will be able to download the source code for the new release starting tomorrow. Links to our new download site will be emailed out individually to each customer.
A new evaluation version containing the new features will be available next week.
May 11th, 2009, Author: guenter, Category: Development
The new Open Service Platform release in 2009.1 includes a new feature: signed bundles. It is now possible to digitally sign a bundle with an X.509 certificate, using an RSA-SHA1 signature.
Digitally signed bundles offer the following features:
- A signed bundle allows to confirm the author of the bundle, through the author’s digital (public key) certificate.
- A signed bundle guarantees that its contents have not been modified since the bundle was signed.
The two main uses for signed bundles in an OSP based applications are:
- allowing only bundles from certain well-known and trusted sources being loaded into the application, and
- preventing end users from tampering with the contents of bundles.
It must be stated that a signed bundle is not an encrypted bundle. All files stored in a signed bundle are unencrypted (unless they have been encrypted by application-specific means), and thus readable for everyone.
Signed bundles in OSP are in concept very similar to signed JAR files used by Java. Some implementation details are different, though, and the formats are not compatible.
Support for signed bundles in OSP is implemented in the OSPBundleSign library (namespace Poco::OSP::BundleSign). The signbundle tool is used to sign a bundle, or verify the signature of a bundle.
For more information about this feature, please see the documentation.
April 28th, 2009, Author: guenter, Category: Development
With the POCO C++ Libraries Release 1.3.4 finally out, it’s only a few more days until the release of the POCO Platform 2009.1 release. 2009.1 will include improvements to Remoting and the Open Service Platform. Especially the integration between Remoting and OSP has been greatly improved.
It is now possible to generate Remoting services that can be registered as OSP services. How is this done? The Remoting code generator has a new option for creating OSP-based services. When this option is enabled, the base class of the interface class is no longer Poco::RefCountedObject, but Poco::OSP::Service. This means that generated Proxy and RemoteObject classes can be registered as OSP services with the OSP ServiceRegistry.
To enable this option, the code generator can either be invoked with the –osp option, or an additional setting can be added to the code generator configuration file:
<osp>
<enable>true<enable>
<osp>
The code generator can now also automatically generate the code for a BundleActivator, both for client and servers.
With this new feature, it is now possible to have location-transparent OSP services. On a server, simply deploy the server bundle. On a client, deploy the client bundle. Or deploy both the server and the client bundle to a single OSP application.
The Open Service Platform has another nice addition in 2009.1 — the OSP Shell. This is a new OSP service that implements command-line administration features for OSP. The service is accompanied by a small command line utility that reads commands from the user, sends them to the service, and displays the output from the command back to the user.
The OSP Shell basically has the same features as the existing Web-based Bundle Admin utility. It is possible to list the currently available bundles, control the lifecycle of bundles, install new bundles, etc. But probably the best features about the Shell service is that it is extensible. It is very easy to add custom commands to an application.
To add a custom command to the Shell, one only needs to create a subclass of Poco::OSP::Shell::Command, and register this new command using a special extension point.
For example, a simple Echo command implementation looks like this:
class EchoCommand: public Poco::OSP::Shell::Command
{
public:
int execute(Poco::OSP::Shell::Session& session,
const std::vector& args,
std::ostream& ostr)
{
for (int i = 1; i < args.size(); ++i)
{
if (i > 1) ostr << ' ';
ostr << args[i];
}
ostr << std::endl;
return Command::STATUS_OK;
}
};
March 17th, 2009, Author: guenter, Category: C++, Development
Good news for everyone wanting to use the POCO C++ Libraries or the POCO Platform (especially Remoting or Fast Infoset) in the development of an iPhone application. The POCO libraries can now be built for the iPhone using Apple’s iPhone SDK and tools, and we successfully ran an application using POCO on the iPhone as well. Except for a little change that was necessary (the iPhone, in contrast to Mac OS X, has no struct stat64), POCO builds out of the box for the iPhone. Main work was finding the correct compiler and linker options. The upcoming 2009.1 release will include a build configuration file for the iPhone. Using POCO from Objective-C++ code works well, provided that the project settings are correctly set in Xcode (e.g., treat all source files as Objective-C++ instead of Objective-C, enable C++ exceptions and RTTI). We’ll probably soon see the first iPhone applications using POCO.
March 11th, 2009, Author: guenter, Category: C++, Development, Fun, News
 Digi Connect ME 9210
We recently got our hands on a Digi Connect ME 9210, one of the smallest Linux-capable embedded computers in the world. The system, which is just a bit larger than an Ethernet RJ-45 socket, is based on an ARM9 CPU running at 75 MHz. With 4 MB of Flash and 8 MB or DRAM, the system is powerful enough to run POCO-based applications. For example, we ported the Mindstorms/iPhone controller application from the demo we showed at Embedded World in Nuremberg to the Connect ME, and it runs great. Well, porting is a bit overstating, as we merely had to build a new Flash image for the Connect ME, and update the application’s config file. Well, a 75 MHz ARM9 CPU provides enough power to run an application with a built-in web server powering an Ajax-enabled website. Also, the performance improvements for the 1.3.4 release help a lot to make the application work great. Additionally, the 1.3.4 release will introduce some minor changes to help reduce the executable size of statically linked applications. For example, it is possible to build the Util library without XMLConfiguration support, which prevents the XML library from being linked in, cutting about 500K from the executable size.
Working with this little device has been a lot of fun, and we are looking forward doing some cool projects with it.
|
| |
|
 |