views:

50

answers:

1

I've created a Asp.net MVC web application that has a SQL Server attached to it. I would like to update the database on an action (in this case a physical card swipe). I have a microcontroller that stores the identification number and then can connect via tcp to the site.

What is the best approach for allowing the microcontroller to add data to the database attached to my MVC website? I was considering setting up an API similar to the one described here, and just posting to the website constantly. Is this the best approach to the problem?

Thanks!

A: 

Yes, it'd be pretty straightforward to have the uC do an HTTP POST to a specific URL and have your website do something in your database as a result.

This example of dealing with POST in asp.net MVC might help.

I'd be strongly considering using SSL/TLS with a client certificate, if your microcontroller can handle it. Otherwise your application could be open to spoofing (someone pretending to be the card reader) or sniffing (monitoring of traffic between the reader and your web server).

There appear to be several options for embedded SSL/TLS stacks in a Google search for "embedded ssl".

Also, if you're dealing with credit cards you'll want to be sure you're aware of the Payment Card Industry Data Security Standard (PCI-DSS).

dmc